views:

15

answers:

1

Hey Everyone,

I didn't know if anyone here has had experience with the gtm-http-fetcher provided by google. I am specifically looking to modify the HTTP headers in a request. Any help or examples would be appreciated.

-Pat

+1  A: 

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