In my last entry about
Debugging REST and AJAX, I talked about using telnet as an easy way to figure out WTF is going on with your application, if you have some kind of general badness.
Incidentally enough, it also comes in handy when you want to quickly do a var_dump, or other debugging. I found though, that when using PuTTY to paste in signficant chunks of urlencoded data, that there was some kind of server/client communication issues.
Enter
cURL, the ultimate in HTTP debugging tools. You can pass in request data via the --data option, conversely, there is always the --form option if that is your cup of tea. There are ways to set the referer, user agent, cookies, even teh request method. Its mighty nice.
For instance, I was working on my
Tile Editor (more on this real soon), and I was having a problem with my AJAX put request. I snarfed the headers my browser was sending using HttpLiveHeaders, grabbed the request vars, and stashed that in a file called 'requestdata'. Then I told curl to read that in as request data, and spit out the response data. Finally, I wanted to use the PUT method, and this was as easy as using the --request option.
curl --data @requestdata --include --request PUT http://bunny.jonnay.net/projects/TileEditor/tiles/tile.php/43c97b37c7211
Clickity Click. Barba Trick. cURL is mana from heaven for the HTTP hacker.