Simple HTTP Testing Utility

There was an interesting post on Ajaxian last week about a testing utility for XMLHttpRequest. Kris Zyp had written RESTTest for his own uses and talked about it during his session at The Ajax Experience. There were requests to make his utility openly available, so he did just that. The comments on the post point to other such utilities; all of which I have problems with that Adobe AIR can solve.

The first problem is a dependency on Firefox. Over the past few releases, I’ve found Firefox increasingly unstable on Mac (which I use for development). I now use Safari 3 as my primary browser. There’s a side benefit in that Adobe AIR uses WebKit for it’s HTML rendering, so it makes my life easier to just use Safari. That means in order to run RESTTest or Poster, I’d have to run both Safari and Firefox - and that I’d be running Firefox just for the extension.

The second problem I have is that I don’t know XUL or how to make a Firefox extension. If I wanted to extend any of the existing projects, I’ve have to learn a new skill. At that it’d be a new skill that’d only be applicable for Firefox or other XUL-centric projects. I do know HTML, JavaScript and CSS however, so I could build right away with Adobe AIR, and not have to learn any new languages or mark-up schemas.

I’ve been doing a lot of development against the Adobe Share API’s of late, so having a testing utility handy would prove really useful, but I don’t run Firefox and don’t know XUL. Inspired by the work on RESTTest and Poster, I set out to make my own little testing utility. I call mine HTTP Tester, and it was written entirely with pure HTML, JavaScript and CSS.

AIR HTTP Tester

I had to know nothing about Adobe AIR other than how to use the Dreamweaver CS3 extension to test and package the application (two simple dialog boxes). Aptana has a similar plug-in. Even if I was going with the lowest common denominator of the command-line, I’d only have to learn about AIR’s XML descriptor file and the command-line options. To actually build the application there’d be no Firefox-specific tutorials or learning XUL, just good old W3C standards.

There’s one other utility mentioned in the Ajaxian thread, Fiddler. The problem I have with Fiddler is that, again, I run a Mac and Fiddler is Windows only. It looks like a great standalone tool, but I need my applications to be available on the Mac, if not competely cross-platform. Since I used Adobe AIR, my HTTP Tester utility will work on Mac and Windows today, and Linux in the near future (AIR is still a beta technology and not yet available on Linux).

There’s an entire aspect I chose to ignore for this application, desktop integration. If I was willing to learn just a little more about Adobe AIR, specifically a few new classes, I could add features like storing preferences and requests/responses to the local disk, and native drag and drop of data files into/out of the application. I could also freely access the clipboard. I’ve already been able to stylize the application using only my existing HTML knowledge, but this could even be extended to custom chrome.

I don’t plan to do any further development on this project, as it was simply an experiment to see if an equivalent tool could be created using only HTML, JavaScript and CSS with Adobe AIR. I also haven’t done any extensive testing of the tool beyond a few queries of each HTTP method (GET, POST, PUT, DELETE), so this isn’t really a production quality tool. Feel free to take the source code an expand and/or improve upon it. Or just explore the project to see just how far your HTML knowledge can take you on the desktop.

WordPress database error: [Can't open file: 'wp_comments.MYI' (errno: 145)]
SELECT * FROM wp_comments WHERE comment_post_ID = '130' AND comment_approved = '1' ORDER BY comment_date

Leave a Reply