Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP test server accepting GET/POST requests

Tags:

http

post

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?

like image 934
John Twigg Avatar asked Apr 20 '11 04:04

John Twigg


People also ask

How do I test a HTTP POST request?

Here are some tips for testing POST requests: Create a resource with a POST request and ensure a 200 status code is returned. Next, make a GET request for that resource, and ensure the data was saved correctly. Add tests that ensure POST requests fail with incorrect or ill-formatted data.

What is HTTPBin used for?

HTTPBin is an open source HTTP request and response service, which happens to exist as a simple API, that has a whole range of uses, and to help me load up all the details into my brain I wanted to write out the essentials of HTTPBin as derived from the OpenAPI definition that is published to Github.

How do I run HTTPBin locally?

Build and run locally Access and test the httpbin locally via http://localhost:8080/ip. Browse to http://localhost:8080 for a complete list of supported features. PS: If you need to track your requests you might want to use requestbin which is capable of recording requests...

How does HTTP GET and POST work?

By design, the POST request method requests that a web server accept the data enclosed in the body of the request message, most likely for storing it. It is often used when uploading a file or when submitting a completed web form. In contrast, the HTTP GET request method retrieves information from the server.


2 Answers

https://httpbin.org/

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

  • https://httpbin.org/anything Returns most of the below.
  • https://httpbin.org/ip Returns Origin IP.
  • https://httpbin.org/user-agent Returns user-agent.
  • https://httpbin.org/headers Returns header dict.
  • https://httpbin.org/get Returns GET data.
  • https://httpbin.org/post Returns POST data.
  • https://httpbin.org/put Returns PUT data.
  • https://httpbin.org/delete Returns DELETE data
  • https://httpbin.org/gzip Returns gzip-encoded data.
  • https://httpbin.org/status/:code Returns given HTTP Status code.
  • https://httpbin.org/response-headers?key=val Returns given response headers.
  • https://httpbin.org/redirect/:n 302 Redirects n times.
  • https://httpbin.org/relative-redirect/:n 302 Relative redirects n times.
  • https://httpbin.org/cookies Returns cookie data.
  • https://httpbin.org/cookies/set/:name/:value Sets a simple cookie.
  • https://httpbin.org/basic-auth/:user/:passwd Challenges HTTPBasic Auth.
  • https://httpbin.org/hidden-basic-auth/:user/:passwd 404'd BasicAuth.
  • https://httpbin.org/digest-auth/:qop/:user/:passwd Challenges HTTP Digest Auth.
  • https://httpbin.org/stream/:n Streams n–100 lines.
  • https://httpbin.org/delay/:n Delays responding for n–10 seconds.
like image 81
Robert Avatar answered Sep 19 '22 21:09

Robert


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."

like image 42
catbot Avatar answered Sep 22 '22 21:09

catbot