I am setting up a request to my server, I have been helped out with a few suggestions but I am wanting some clarification on a part of code.
in the second line of code, what are the setValue: and forHTTPHeaderField: values used for? I’m thinking forHTTPHeaderField: sets the mime type… but im not sure what setValue is for or how it effects my request.
[request setHTTPMethod: @"POST"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];
[request setHTTPBody:postBodyData];
any help would be greatly appreciated.
See the NSMutableURLRequest reference for the method description and HTTP documentation at 14.17 Content-Type section for the header information.
More C-T details at the section 7.2.1