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" }
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.
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.
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.
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" }
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...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With