asp*_*man 5 objective-c iphone-sdk-3.0
无法从响应中获取"位置"标题.Wireshark说我有一个:
地点:http://*/index.html#0; sid = 865a84f0212a3a35d8e9d5f68398e535
但
NSHTTPURLResponse *hr = (NSHTTPURLResponse*)response;
NSDictionary *dict = [hr allHeaderFields];
NSLog(@"HEADERS : %@",[dict description]);
Run Code Online (Sandbox Code Playgroud)
产生这个:
HEADERS : {
Connection = "keep-alive";
"Content-Encoding" = gzip;
"Content-Type" = "text/html";
Date = "Thu, 25 Mar 2010 08:12:08 GMT";
"Last-Modified" = "Sat, 29 Nov 2008 15:50:54 GMT";
Server = "nginx/0.7.59";
"Transfer-Encoding" = Identity;
}
Run Code Online (Sandbox Code Playgroud)
没有位置.怎么弄?我需要这个"sid"的东西.
NSHTTPURLResponse是一个子类,NSURLResponse所以你可以问它的URL.这将返回一个NSURL对象,您可以从中获取URL组件,例如查询,参数字符串或片段.在您的情况下,您需要片段组件:
NSURL* url = [response URL];
NSString* fragment = [url fragment];
//fragment should be: 0;sid=865a84f0212a3a35d8e9d5f68398e535
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5704 次 |
| 最近记录: |