Imagine you have a site API that accepts data in the form of GET requests with parameters, or as POST requests (say, with standard url-encoded, &-separated POST data).
Use Apache's mod_dumpio. Be careful for obvious reasons.
Note that mod_dumpio stops logging binary payloads at the first null character. For example a multipart/form-data
upload of a gzip'd file will probably only show the first few bytes with mod_dumpio.
Also note that Apache might not mention this module in httpd.conf
even when it's present in the /modules
folder. Just manually adding LoadModule
will work fine.
An easier option may be to log the POST data before it gets to the server. For web applications, I use Burp Proxy and set Firefox to use it as an HTTP/S proxy, and then I can watch (and mangle) data 'on the wire' in real time.
For making API requests without a browser, SoapUI is very useful and may show similar info. I would bet that you could probably configure SoapUI to connect through Burp as well (just a guess though).