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