Abh*_*nav 31 iphone cocoa-touch objective-c nsurlconnection
如何从服务器响应中发送的标头中读取数据.我正在使用NSURLConnection发送请求.
Joh*_*eek 77
如果URL是HTTP URL,那么NSURLResponse
您在连接的委托-connection:didReceiveResponse:
方法(或通过其他方法)中收到的URL 将是一个NSHTTPURLResponse
,它具有一个-allHeaderFields
允许您访问标头的方法.
NSURLResponse* response = // the response, from somewhere
NSDictionary* headers = [(NSHTTPURLResponse *)response allHeaderFields];
// now query `headers` for the header you want
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
19701 次 |
最近记录: |