开发者

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:)];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜