No http headers
I am trying to find the http headers but I don't think my method is working. I am using
- (BOOL)webView:(UIWebView *)webView2 shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType {
NSMutableURLRequest *req = (NSMutableURLRequest *)request;
NSLog(@"u开发者_开发技巧ser agent = %@", [req valueForHTTPHeaderField: @"User-Agent"]);
NSLog(@"http headers = %@", [request allHTTPHeaderFields]);
NSLog(@"http headers = %@", [req allHTTPHeaderFields]);
}
But the NSLog is printing out
http headers = {
Both req and request are not nil. Does anyone know why I am unable to get the headers?
Thanks Clinton
精彩评论