Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Such thing as a dummy REST server to test HTTP requests? [closed]

Tags:

http

testing

web

I have been searching around but cannot find any site like this. I want to know if there is some dummy server that will respond to test GET requests and return a JSON object? Basically something like:

HTTPUtil.httpGet("http://www.ipsumlorem.com/json"); 

and have it return filler text JSON objects like:

{    "title" : "Ipsum Lorem",    "content" : "blah blah blah" } 
like image 914
Matt Hintzke Avatar asked Jul 18 '13 21:07

Matt Hintzke


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.

How do I send a request to HTTP server?

An HTTP client sends an HTTP request to a server in the form of a request message which includes following format: A Request-line. Zero or more header (General|Request|Entity) fields followed by CRLF. An empty line (i.e., a line with nothing preceding the CRLF) indicating the end of the header fields.

How do I test a postman URL?

To test sending a request in Postman, you can set the URL to the Postman Echo sample API endpoint https://postman-echo.com/get and the method to GET , then select Send.


2 Answers

http://www.jsontest.com/ will be your new best friend I guess...

Try this out for your need: http://echo.jsontest.com/title/ipsum/content/blah

It will return this:

{    "content": "blah",    "title": "ipsum" } 
like image 199
Laurent Bristiel Avatar answered Oct 17 '22 07:10

Laurent Bristiel


You can use also www.mocky.io, where you mock your HTTP responses to test your REST API.

It is possible to change also the headers of the response and of course to write precisely the content (including json...)

like image 21
medCoder Avatar answered Oct 17 '22 07:10

medCoder