Reputation: 4551
I'm using ASIHTTPRequest in my iOS project. i would like to see all the http headers of my request to the server. How I can see this with ASIHTTPRequest?
Is there any tool like fiddler in the mac?
Thanks for your answer
Upvotes: 3
Views: 2696
Reputation: 581
You can also set the following macro below which is found in ASIHTTPRequestConfig.h, I've used this to help with debugging HTTP headers.
#define DEBUG_REQUEST_STATUS 1
Upvotes: 3
Reputation: 7303
You can just print them out:
// headers in server response
- (void)requestFinished:(ASIHTTPRequest *)request
{
NSLog(@"headers: %@", [request responseHeaders]);
}
And to see the headers of your request:
NSLog(@"headers: %@", [request requestHeaders]);
Upvotes: 1
Reputation: 6102
There is a requestHeaders
property. It is NSMutableDictionary
, so you can iterate through it. Dictionary key is name of header and dictionary value for this key is value of header with this name.
Upvotes: 1