2
我得到的JSON結果爲-JSONValue failed. Error is: Unexpected end of input
。請以正確的方式指導我。-JSON值失敗。錯誤是:意外的輸入結束
我是新的解析。我必須通過POST方法從服務器獲取數據。我有以下細節。我必須通過url的郵編
{"zip":"52435","methodIdentifier":"search_dealer"}
url : http://usaautoleads.com/api.php
method: post
web service name: search_dealer
response : {"success":"0","dealer":[info...]}
我的代碼在這裏。
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];
這是你的迴應信息?說清楚... – 2012-07-11 12:17:23
-JSON值失敗。錯誤是:意外的輸入結束 – QueueOverFlow 2012-07-11 12:26:05
@InderKumarRathore我沒有收到我的迴應字符串 – QueueOverFlow 2012-07-11 12:37:51