I am working with a wrapper class for CFHTTPMessage
, which contains a CFHTTPMessageRef
object to which is added the method (GET), the URL of the web application server, and a few custom headers containing the date and an authentication nonce.
I'm having some problems getting the method and URL to return certain data. I think I've worked out the authentication nonce.
I'd like to troubleshoot this by looking at the raw request going to the web application, and making sure everything is formatted properly.
My question is: If I have a CFHTTPMessageRef
object (e.g. messageRef
), is there a way to log the raw HTTP request that comes out of this message?
I've tried the following but I get a EXC_BAD_ACCESS
signal when I try to access its bytes:
CFDataRef messageData = CFHTTPMessageCopyBody(messageRef);
Thanks for any advice.
As an alternative, is it possible to use a packet sniffer on a switched network? I can run ettercap
on a laptop device, but don't know how to sniff what my iPhone is doing on the local wireless network.