Class NSURLRequest. Method - (NSInputStream *)HTTPBodyStream always returns nil. Why?
-
20-09-2019 - |
Question
I am trying to use NSURLRequest with NSURLConnection to establish a binary stream connection to an HTTP server to retrieve a humungous data file in small, incrementally pieces.
I see the method - (NSInputStream *)HTTPBodyStream on NSURLRequest. Is that the method I want to call on my instance of NSURLRequest? If so why does it alway return nil?
Solution
To get data back u must send request using nsurlconnection, u can use either asynchronous or sync requests here is a link http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html
OTHER TIPS
Actually, I now realize that HTTPBodyStream is relevant when doing an HTTP PUT. I am doing a GET. Never mind.