samir
samir

Reputation: 4551

ASIHTTPRequest debugging

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

Answers (3)

jdmunro
jdmunro

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

David
David

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

knuku
knuku

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

Related Questions