• 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: File Uploading to HTTP server using CFHTTPMessage API fails
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File Uploading to HTTP server using CFHTTPMessage API fails


  • Subject: Re: File Uploading to HTTP server using CFHTTPMessage API fails
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 12 Jan 2012 22:43:36 -0800


On Jan 12, 2012, at 10:07 PM, DEBAPRIO BANIK wrote:

Unable to find any API's for setting the headers of the http request with NSURL.

Look at NSMutableURLRequest. It has methods like -setValue:forHTTPHeaderField:.

Why API's for uploading the file to the server needs to go through NSInputStream? Its output from client perspective. So
isn't the API's are bit odd !

Because the connection needs to _read_ from the stream to send the data to the socket.
Think of it this way: The NSURLConnection is on the other side of the stream from you. From your perspective you’d write to it, but from its perspective it reads from it.

If you have any sample code where a http request is created, body is set and send to the server, will be great help.

Apple’s docs have plenty of code like that. Read the “URL Loading System Programming Guide”.

—Jens
 _______________________________________________
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: 
 >File Uploading to HTTP server using CFHTTPMessage API fails (From: DEBAPRIO BANIK <email@hidden>)
 >Re: File Uploading to HTTP server using CFHTTPMessage API fails (From: Jens Alfke <email@hidden>)
 >Re: File Uploading to HTTP server using CFHTTPMessage API fails (From: Jens Alfke <email@hidden>)
 >Re: File Uploading to HTTP server using CFHTTPMessage API fails (From: Jens Alfke <email@hidden>)
 >Re: File Uploading to HTTP server using CFHTTPMessage API fails (From: DEBAPRIO BANIK <email@hidden>)

  • Prev by Date: Re: File Uploading to HTTP server using CFHTTPMessage API fails
  • Next by Date: Re: File Uploading to HTTP server using CFHTTPMessage API fails
  • Previous by thread: Re: File Uploading to HTTP server using CFHTTPMessage API fails
  • Next by thread: Re: File Uploading to HTTP server using CFHTTPMessage API fails
  • Index(es):
    • Date
    • Thread