• 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
Best Way to Replicate CURL in Cocoa?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Best Way to Replicate CURL in Cocoa?


  • Subject: Best Way to Replicate CURL in Cocoa?
  • From: Brad Gibbs <email@hidden>
  • Date: Tue, 1 Apr 2008 05:39:35 -0700

Hi,

I'm trying to communicate with a Linux-based device that sits on the local network from multiple Macs (also on the local network). Documentation for the Linux device claims that it provides an XML-RPC server and that it responds to SOAP requests. However, XML-RPC and SOAP AppleScripts result in repeated failure. "do shell script curl", however, works every time. I suspect that the device doesn't actually respond to tree-based XML with tags, but it does respond when the full message (which consists of a method name and 0-5 parameters, depending on the method) are all posted in a single string.

Given this, I'm suspecting it responds to HTTP Posts, rather than XML- RPC or SOAP requests. 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. The strings I'll be sending will be less than 50 characters long. The device will also be sending response strings of approximately the same length that will need to be parsed in the Cocoa app. Again, it doesn't appear that the responses are XML (they're all in a single string, no tags).

Messaging to the device will be driven by button presses in the UI. A single button press could invoke up to 5 or 6 messages at once, but the button presses will likely be infrequent. A single instance of the app could be running on multiple machines, with each machine making requests to the device simultaneously.

Given this information, what would be the most efficient and robust method for sending HTTP Posts, CF Network, NSURLRequest or something completely different?

Thanks in advance.

Brad
_______________________________________________

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


  • Follow-Ups:
    • Re: Best Way to Replicate CURL in Cocoa?
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Exploring AppleScript APIs
  • Next by Date: NSView out of memory problem
  • Previous by thread: Re: Exploring AppleScript APIs
  • Next by thread: Re: Best Way to Replicate CURL in Cocoa?
  • Index(es):
    • Date
    • Thread