• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Best Way to Replicate CURL in Cocoa?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best Way to Replicate CURL in Cocoa?


  • Subject: Re: Best Way to Replicate CURL in Cocoa?
  • From: Brad Gibbs <email@hidden>
  • Date: Tue, 1 Apr 2008 09:03:22 -0700

Thanks for the reply.



On Apr 1, 2008, at 8:51 AM, Jens Alfke wrote:


On 1 Apr '08, at 5:39 AM, Brad Gibbs wrote:

Given this, I'm suspecting it responds to HTTP Posts, rather than XML-RPC or SOAP requests.

But both those protocols do use HTTP POSTs. (XML-RPC can use alternate transports, but in practice it's almost always over HTTP.)

Fair point. I didn't use the correct terminology (which stems from the fact that I'm stumbling around a bit while learning this). I think it's more accurate to say that the device doesn't respond well to the tags in XML-RPC or SOAP. It does better with a single string.




I've seen references to a Cocoa wrapper for curl, but they're from 2002. Looking through Apple's documentation for a more up-to-date method for sending HTTP Posts, it appears that I could make HTTP Posts from CFNetwork (CFHTTPMessage with a POST method) or through NSURLRequest.

Pretty much every Cocoa app that does HTTP uses NSURLRequest. It's definitely the way to go for what you're doing. Create a mutable one, then use its HTTP-specific setters to configure the method and headers and set a body.


—Jens

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Best Way to Replicate CURL in Cocoa? (From: Brad Gibbs <email@hidden>)
 >Re: Best Way to Replicate CURL in Cocoa? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Best Way to Replicate CURL in Cocoa?
  • Next by Date: Re: Network notifications
  • Previous by thread: Re: Best Way to Replicate CURL in Cocoa?
  • Next by thread: NSView out of memory problem
  • Index(es):
    • Date
    • Thread