Echo http requests

Echo is a tool for testing how your applications handle http and websocket responses. It allows you to define a http response in the request its self.

http://echo.nathansplace.co.uk/echo?body=hello

Usage

Websockets

Javascript example

A minimal javascript example.

  var socket = new WebSocket("ws://echo.nathansplace.co.uk/echo");

  socket.addEventListener("message", function(e) {
    var message = e.data;
    console.log("got `" + message + "`");
  });

  socket.send("ECHO...");

HTTP

Echo takes the following params, either as json, or url encoded query string.

Echo will respond to the following http verbs:

CORS headers are set for you.

Curl example

A post request with json body and json response:

curl -v -X POST http://echo.nathansplace.co.uk/echo \
  -H "Content-Type: application/json" \
  -d '{"body": "{\"teapot\": true}", "status": 418, "headers": {"Content-Type": "application/json"}}'