Skip to content
A simple "echo" webservice for testing
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information. Refer to new blog post talking about similar services which are still… Apr 30, 2019
echo.php include usage of "ip" request param Oct 22, 2015

Echo Webservice

A simple webservice call which echos back data about the request. Can be useful for testing and debugging webservice clients.

Inspired by and (both of which are no longer in service). See my blog post Recent HTTP Request Inspector Services for an updated list of similar services. is similar with lot of additional controls about the response generation.


Make a request to the Echo service using Curl or your webservice client or app:

By default, the service responds with plain text, but can return JSON or XML.

Data Returned

In all data formats, the following data is returned:

  • method: the HTTP method used (GET, HEAD, POST, etc.)
  • headers: all HTTP headers received
  • request: all data parameters (query parameters or POST data)
  • client_ip: best guess at originating client IP address (from HTTP headers)
  • time_utc: request time (UTC)


Plain text response:

$ curl
    [method] => GET
    [headers] => Array
            [User-Agent] => curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3
            [Host] =>
            [Accept] => */*

    [request] => Array
            [foo] => bar

    [client_ip] =>
    [time_utc] => 2012-01-08T21:33:28+0000
    [info] => Echo service from Scooterlabs (

Plain text response with public IP address:

$ curl

JSON response:

$ curl --silent curl | json_xs
   "info" : "Echo service from Scooterlabs (",
   "request" : {
      "foo" : "bar"
   "headers" : {
      "User-Agent" : "curl/7.21.3 (i386-portbld-freebsd7.3) libcurl/7.21.3 OpenSSL/1.0.0e zlib/1.2.3 libidn/1.22",
      "Accept" : "*/*",
      "Host" : ""
   "client_ip" : "",
   "time_utc" : "2012-01-08T22:07:54+0000",
   "method" : "GET"

XML response:

$ curl --silent | xml_pp

<?xml version="1.0"?>
    <User-Agent>curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3</User-Agent>
  <info>Echo service from Scooterlabs (</info>


To run on your own server, install echo.php file to a suitable location and add the following to your Apache config or local .htaccess file:

# Echo test script
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^echo /echo.php [L]

If you install echo.php into a location other than the root of your web server, you'll need to adjust the rewrite rules a bit.

You can’t perform that action at this time.