Echo your REST calls with a echo service

Echo services are a simple tool for developing and testing

When you implement a service are often in a situation where you have to call another web service, for example service B. And to complicate the situation, service B is not fully implemented or even not available. Than an echo service could make sense for you.

There a couple of services your could use. I tried an service as an docker image: https://github.com/mendhak/docker-http-https-echo.

Just start the docker container like this

docker run -p 8080:80 -p 8443:443 --rm -t mendhak/http-https-echo

And then you can request a resource via curl:

curl -d '{"key1":"value1", "key2":"value2"}' -H "Content-Type: application/json" -X POST http://localhost:8080/helloworld

You get your request echoed and with docker logs you can see your request in a log too. I think that’s cool. If you like node.js that could find https://www.npmjs.com/package/http-echo-server more interesting.

I really like echo services for simple use cases. But if your interested in more advanced use cases than tools like mountebank or wiremock are more pwerful solutions. These tools are test doubles over the wire. Just point your test over http. And this way you can stub and mock web services in your tests.

Links

https://github.com/mendhak/docker-http-https-echo

https://www.npmjs.com/package/http-echo-server

http://www.mbtest.org/

http://wiremock.org/