Today I was working on a JAVA program that had to send GET requests to a RESTFul webservice. For debugging purposes I wanted to make sure that my program send the key-value pairs in such a way that PHP (and other web scripts) would understand it. Of course I could c/p the output URL and check it by hand, but errors can creep up easily that way.

The script (really 3 lines of PHP and a few lines of HTML) echos all the GET key-value pairs so that you can easily check if everything is alright (for example check if the URLEncoding worked) .

To use the scrip just navigate your program to

In your application you should see output like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="" xml:lang="en" lang="en">
 <title>REST GET echo service</title>
This simple PHP script will output all the get variables which where sent in the last HTTP request.
GET variables received: <br/>
    [MyKey] => MyValue

Of course you can also try it from your browser.

Anyway, have fun with it, it’s just tiny debugging tool that saves you the 5 minute trouble of firing up your own host and typing three lines of PHP.