开发者

gtm-http-fetcher modify HTTP Headers

开发者 https://www.devze.com 2023-01-17 01:08 出处:网络
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 woul

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

精彩评论

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