Are there any equivalents in objective-c to the following python urllib2 functions?
Request, urlopen, HTTPError, HTTPCookieProRequest, urlopen, HTTPError, HTTPCookieProcessor
Also, how would I able to to this and change the method from “get” to “post”?
NSMutableHTTPURLRequest, a category ofNSMutableURLRequest, is how you set up an HTTP request. Using that class you will specify a method (GET or POST), headers and a url.NSURLConnectionis how you open the connection. You will pass in a request and delegate, and the delegate will receive data, errors and messages related to the connection as they become available.NSHTTPCookieStorageis how you manage existing cookies. There are a number of related classes in theNSHTTPCookiefamily.With
urlopen, you open a connection and read from it. There is no direct equivalent to that unless you use something lower level likeCFReadStreamCreateForHTTPRequest. In Objective-C everything is passive, where you are notified when events occur on the stream.