【发布时间】:2011-05-05 10:29:43
【问题描述】:
我用这个向网络服务器发出 http 请求:
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString: @"http://server.com"]];
[request setHTTPMethod: @"POST"];
[request setHTTPBody: myRequestData];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];
NSData *returnData = [NSURLConnection sendSynchronousRequest: request returningResponse: nil error: nil];
但是我怎样才能从服务器获取响应并对其进行解析呢?非常感谢:)
【问题讨论】:
标签: iphone ios nsurlrequest