I am trying to post a string with 2 values to a URL. To define my string I am using:
NSString *post = [NSString stringWithFormat:@"...."];
NSData *postData = [post dataUsingEncoding: .... allowLossyConversion: NO];
The string I want to post is this one: geoX#value #geoY#value.
How do I add this string in my NSString command and what type of dataUsingEncoding should I use?
Also at the command:
[request setValue:@"....." forHTTPHeaderField:"...."]
What value do I add and what type of content if header –>content-type :text/html?
Assuming that you have the values stored in two variables as follows,
This is how you need to append the values to string,
To convert this to data, you can use the following line,
And to set the content-type in header, try this,
Hope it is clear now.