gtm-http-fetcher modify HTTP Headers
I didn't know if anyone here has had experience with the gtm-http-fetcher provided by google. I am specifica开发者_Go百科lly looking to modify the HTTP headers in a request. Any help or examples would be appreciated.
-Pat
Since you supply the request to be fetched, you can specify the headers in the request as well. For example,
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setValue:@"MyApp" forHTTPHeaderField:@"User-Agent"];
GTMHTTPFetcher *fetcher = [GTMHTTPFetcher fetcherWithRequest:request];
[fetcher beginFetchWithDelegate:self
didFinishSelector:@selector(fetcher:finishedWithData:error:)];
精彩评论