0
我发送一个NSURLSessionDataTask
,并且我得到NSData
作为响应。它应该包含XML
。但我无法得到它。从NSURLSessionDataTask请求的NSData响应获取XML
当我发送命令行上一个curl
请求时,它按预期工作
NSURLSessionDataTask* dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { //5
if (!error) {
NSLog(@"%@", [response description]);
NSLog(@"%@", data); // some data I can not understand.
}
}];
请求:
{
"Content-Type" = "application/xml; charset=\"utf-8\"";
}
响应
{ status code: 207, headers {
"Accept-Ranges" = bytes;
Connection = close;
"Content-Length" = 1282;
"Content-Type" = "text/xml";
请提供指针
感谢...我注意到,刚才......将接受答案 – GJain 2014-12-03 10:11:40