Thursday 15 April 2010

ios - NSString constants for NSURLRequest HTTPMethod property? -



ios - NSString constants for NSURLRequest HTTPMethod property? -

does foundation have nsstring constants supported httpmethod values (eg get, post, etc)?

searched nsurlrequest docs, couldn't find anything.

to knowledge, nsurlrequest doesn't have constants http method types. could, however, define own , utilize them elsewhere. this:

//somewhere #define setpost(request) [request sethttpmethod:@"get"] //...later in code nsmutableurlrequest *request = [[nsmutableurlrequest alloc] init]; setpost(request);

i highly recommend using afnetworking. library, can things like:

[connectionmgr post:url parameters:submitdict success:nil failure:nil]; //obviously bare-bones, you'd need fill in parameters , blocks

ios osx cocoa nsurlrequest

No comments:

Post a Comment