Objective-c - NSURLConnection
某草草
某草草 2017-05-02 09:26:12
0
1
574
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
    NSLog(@"%@----%@-----%@---%@",connection.currentRequest.URL,connection.currentRequest.HTTPBody,connection.currentRequest.HTTPMethod,connection.currentRequest.allHTTPHeaderFields);
}

输出结果如下
http://这里是网址/zines----(null)-----GET---
{

Accept = "application/json";
"Content-Length" = 0;
"Content-Type" = "application/json";

}
为什么用 xcode 就可以得到数据,放到浏览器里就是"Internal Server Error"浏览器输入的地址如下:http://这里是网址/zines
小白一枚,求大神告知,万分感谢!!!

某草草
某草草

全部回复(1)
洪涛

那是报头,每个报文都有,content-length = 0 说明没有数据。你这确定请求成功了吗?

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板