HTTP test server accepting GET/POST requests

477,391

Solution 1

https://httpbin.org/

It echoes the data used in your request for any of these types:

Solution 2

There is http://ptsv2.com/

"Here you will find a server which receives any POST you wish to give it and stores the contents for you to review."

Solution 3

Webhook Tester is a great tool: https://webhook.site (GitHub)

enter image description here

Important for me, it showed the IP of the requester, which is helpful when you need to whitelist an IP address but aren't sure what it is.

Solution 4

http://requestb.in was similar to the already mentioned tools and also had a very nice UI.

RequestBin gives you a URL that will collect requests made to it and let you inspect them in a human-friendly way. Use RequestBin to see what your HTTP client is sending or to inspect and debug webhook requests.

Though it has been discontinued as of Mar 21, 2018.

We have discontinued the publicly hosted version of RequestBin due to ongoing abuse that made it very difficult to keep the site up reliably. Please see instructions for setting up your own self-hosted instance.

Solution 5

nc one-liner local test server

Setup a local test server in one line under Linux:

nc -kdl localhost 8000

Sample request maker on another shell:

wget http://localhost:8000

then on the first shell you see the request showed up:

GET / HTTP/1.1
User-Agent: Wget/1.19.4 (linux-gnu)
Accept: */*
Accept-Encoding: identity
Host: localhost:8000
Connection: Keep-Alive

nc from the netcat-openbsd package is widely available and pre-installed on Ubuntu.

Tested on Ubuntu 18.04.

Share:
477,391
John Twigg
Author by

John Twigg

Updated on July 08, 2022

Comments

  • John Twigg
    John Twigg almost 2 years

    I need a live test server that accepts my requests for basic information via HTTP GET and also allows me to POST (even if it's really not doing anything). This is entirely for test purposes.

    A good example is here. It easily accepts GET requests, but I need one that accepts POST requests as well.

    Does anyone know of a server that I can send dummy test messages too?

  • ozmo
    ozmo over 11 years
    This one is really good if you're running requests that are triggered from a remote server whose internals you don't have access to, as it will save the request for later retrieval.
  • user3280180
    user3280180 over 9 years
    Is there also the possibility to create a local httpbin server?
  • HVNSweeting
    HVNSweeting about 9 years
    @user3280180 $ pip install httpbin gunicorn && gunicorn httpbin:app as mentioned is httpbin.org
  • abalter
    abalter almost 9 years
    The point is to not have to use a server. For instance, what if you want to post a question to SO, but your server may not be around for long. The OP is asking for something permanent such as jsfiddle that can be used to test or demonstrate post.
  • Pablo Cantero
    Pablo Cantero over 8 years
    PutsReq is also similar to RequestBin, but it allows you to write the responses you want with JS.
  • therobyouknow
    therobyouknow over 8 years
    How do you use it - httpbin.org/post doesn't work and on httpbin.org the link has been disabled - it's no longer clickable. Is there something else one should do here? There's no guidance, I'm not a mind reader...
  • Robert
    Robert over 8 years
    @therobyouknow clicking the link performs a GET, but if you do a POST to that url it works. Try: curl -iX POST httpbin.org/post it returns a 200.
  • AlbatrossCafe
    AlbatrossCafe about 8 years
    Great site - it seems the most intuitive and has good documentation that helps you check for things like request type, headers, form data, etc.
  • user239558
    user239558 about 8 years
    At least httpbin.org/headers will return 405 - Method Not Allowed on POST, so this should not be an accepted answer.
  • byxor
    byxor over 7 years
    I know literally anything could be used... But is there a "gettestserver" that's expected to stay up for a long time?
  • ViFI
    ViFI over 7 years
    Unlike httpbin.org/put , it returns a very useful response which gives details about your request. Specially in case of file upload , it is very helpful as you can see your file uploaded on the server which i believe is not possible on httpbin.org .
  • fidev
    fidev almost 7 years
    agreed has nice features where by you can set the specific response you require. i.e. 200 / 301, 401 etc. Good if you want to simulate an error or in my case not route to a page when using a resolve in Angular if the data to render that page hasn't come back (yet)
  • ntninja
    ntninja almost 6 years
    The „cool“ thing about this is that it doesn't use TLS/HTTPS which makes it very easier to debug the bytes on wire.
  • sn.anurag
    sn.anurag over 5 years
    It doesn't display the post data.. I need to see post data.
  • William S
    William S over 5 years
    nc -kdl localhost 8000 will listen in a loop, so no need for the bash while. However, nc will not respond, so the test queries will wait until timeout for the non-response.
  • AmokHuginnsson
    AmokHuginnsson about 5 years
    RequestBin is no longer available.
  • goodeye
    goodeye almost 5 years
    This is very useful to see the request later. But note it has a 1500 char body size limit.
  • Oleg Khalidov
    Oleg Khalidov about 4 years
    Thumb up for https
  • nikniknik
    nikniknik about 4 years
    while true; do echo -e "HTTP/1.1 200 OK\n" | nc -Nl 8000; done will make nc respond with a 200 OK code every time.
  • Sean Breckenridge
    Sean Breckenridge over 3 years
    alias httpbin='docker run -p 80:80 kennethreitz/httpbin' 👍
  • Silvio Biasiol
    Silvio Biasiol over 3 years
    on mac is just nc -l 12345
  • oneworld
    oneworld about 3 years
    Great tool. I can set my response as I need for my program.
  • Christopher Pisz
    Christopher Pisz about 3 years
    I get 404 on all redirect urls
  • Ubdus Samad
    Ubdus Samad almost 3 years
    Currently, httpbin.org isn't working for retries and redirects, so you can use mockbin.org
  • Flair
    Flair over 2 years
  • Mike
    Mike over 2 years
    Please explain how a single one of these options applies to what the OP asked
  • Clain Dsilva
    Clain Dsilva about 2 years
    Why not just use print_r($headers) and avoid the foreach loop?