Objective-c - NSURLConnection
某草草
某草草 2017-05-02 09:26:12
0
1
557
- (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 說明沒有資料。你這確定請求成功了嗎?

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板