Endpoints for HTTP Testing

While working on a book (“PHP Web Services” from O’Reilly, not out yet but soon!) recently, I was looking for some place I could make HTTP requests to, to show off how to make different kinds of requests with different tools. On my own machine, I have a couple of scripts that chatter back giving debug information about the requests that were made, but I wanted to get the tools examples going without any additional dependencies at all. I hadn’t used anything like these tools before, but I found quite a few alternatives, so I thought I’d share what I came up with.

Example.org, Example.net, Example.com

The least exciting example, but a solid one nonetheless, the “example” domains are reserved exactly so that we can use them in all our various example code without annoying anyone when that code gets copied and pasted. I use these in places where I’m using code from a real project, but removing URLs to protect the innocent.

There’s more information about these domains (they have some examples with character encoding in URLs and things also) here: http://www.iana.org/domains/special

Requestb.in

http://requestb.in/

My favourite by far, this got quite a lot of use in the book! The source is available on github as well, so if you need to do in-house testing of any kind then you can make your own copy of this application.

Basically:

  1. Visit the site and create a new “bin”
  2. Make requests to the endpoint you are given
  3. Visit the related view page to view exactly which requests were made, what headers were sent, and so on, all in a pretty graphical setting

requestbin

Respondto.it

http://respondto.it/

This tool is also on github so you can grab, use and adapt it, which is fabulous for developers. It’s slightly more advanced than requestb.in because you can configure responses for particular requests, but still shows you great detail on what was sent and received, which is great. I didn’t use this much because I was really writing toy code but I can see it being a great tool for API development so I’m filing it for future use.

httpbin

http://httpbin.org/

Perhaps a little less shiny than the others, but much more specific in the way it works. You request to different endpoints, and it returns information about what was in the request, rather than making requests from one tool, and viewing information in a web page. This seems like a perfect tool for testing HTTP clients, for example.

HTTP Testing Endpoints

Having taken the time to get to know some of these tools, I think I’ll be using them more in the future rather than the scrappy bits of PHP script that I usually throw together! These endpoints are an easy way for people to test without having to set anything else up, or could even be used for debugging without really knowing what too much about what is going on, for example emailing a requestb.in link with specific query data to check what other headers a client is sending in order to debug a request. There must be plenty of other possibilities too, do you use a tool like this? Leave me a comment!

8 thoughts on “Endpoints for HTTP Testing

  1. What I think would be really useful is a tool whereby we can setup an endpoint base URI and then it collects any subsequent requests. For instance:

    example.com/my-base-path

    This would catch requests and report on them for the following:

    example.com/my-base-path
    example.com/my-base-path/webhook
    example.com/my-base-path/webhook/product/id

    etc.

    We could use this as a permanent tool during testing of our application then.

  2. Pingback: Capturing HTTP requests in an cloud world - I8C

Leave a Reply

Please use [code] and [/code] around any source code you wish to share.

This site uses Akismet to reduce spam. Learn how your comment data is processed.