I got the JSON result as -JSONValue failed. Error is: Unexpected end of input. Please direct me in right way.
I am new in parsing . I have to get Data from the server by POST method. I have following details. I have to pass zip with url
{"zip":"52435","methodIdentifier":"search_dealer"}
url : http://usaautoleads.com/api.php
method: post
web service name: search_dealer
response : {"success":"0","dealer":[info...]}
my code is here.
NSURL *myURL=[NSURL URLWithString:@"http://usaautoleads.com/api.php"];
NSString *post =[[NSString alloc]initWithString:@"52435"];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
[request setURL:myURL];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:postData];
[request setValue:@"application/json" forHTTPHeaderField:@"content-type"];
[[NSURLConnection alloc] initWithRequest:request delegate:self];
The problem here is with your post string. Use this one