Monday November 07, 2011

Debugging NSMutableURLRequests

Spotted this slick shortcut from Mugunth Kumar for debugging NSMutableURLRequests. Just include his two souce files and then when you NSLog() an NSMutableURLRequest, you’ll get a runnable curl command printed to the log. Paste into the terminal and you’ll see exactly what your app got in response.

This works great by itself or with any networking library like ASIHTTPRequest or AFNetworking as long as it exposes NSMutableURLRequests to you.