• 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: CFHTTPRequest issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFHTTPRequest issue


  • Subject: Re: CFHTTPRequest issue
  • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Date: Mon, 29 Apr 2013 10:47:49 +0100

On 29 Apr 2013, at 07:44, Arjun SM <email@hidden> wrote:

> CFReadStreamRef readStream = CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, cfHttpReq);

Hmmm, I'm confused what you're trying to achieve here.  You have two choices:

A. If you want to use CFHTTPStream (that is, have CFNetwork take care of the fiddly HTTP details), you should open your stream using CFReadStreamCreateForHTTPRequest and then you can get the response via the kCFStreamPropertyHTTPResponseHeader property.

B. If you want to use CFSocketStream (that is, take care of the low-level HTTP stuff yourself), you should open your stream using one of the socket stream APIs (typically CFStreamCreatePairWithSocketToHost) then use CFHTTPMessage to create and serialise the outgoing request and parse the incoming response.

Using the combination of CFReadStreamCreateForHTTPRequest (from A) and CFHTTPMessageAppendBytes (from B) is very strange, unless you have nested HTTP responses.

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >CFHTTPRequest issue (From: Arjun SM <email@hidden>)

  • Prev by Date: Re: Our question is how to display in iOS WLAN SSID a subtile that to mark this SSID is our support Wi-If hotspots.
  • Next by Date: Network Service Configuration - SystemConfiguration
  • Previous by thread: CFHTTPRequest issue
  • Next by thread: Re: Our question is how to display in iOS WLAN SSID a subtile that to mark this SSID is our support Wi-If hotspots.
  • Index(es):
    • Date
    • Thread