DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Simulate XHRs With Wget
To test AJAX calls when developing a webapp, XHRs can be simulated by wget:
wget --header="X-Requested-With: XMLHttpRequest" <your-url-here>
wget saves the request to a file by default. To print to the command line:
wget --header="X-Requested-With: XMLHttpRequest" -qO- <your-url-here>
<a href="http://groups.google.com/group/tipfy/browse_thread/thread/520e7726eaf7dd6f">Google Groups reference</a> <a href="http://www.commandlinefu.com/commands/view/1913/redirect-wget-output-to-the-terminal-instead-of-a-file">wget reference</a>





