cari

Rumah  >  Soal Jawab  >  teks badan

objective-c - NSURLConnection

- (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
小白一枚,求大神告知,万分感谢!!!

某草草某草草2757 hari yang lalu533

membalas semua(1)saya akan balas

  • PHP中文网

    PHP中文网2017-05-02 09:28:12

    Itulah pengepala, yang disertakan dalam setiap mesej panjang kandungan = 0 bermakna tiada data. Adakah anda pasti permintaan anda berjaya?

    balas
    0
  • Batalbalas