Question

I am building a library that makes calls to a server that returns JSON. I'd like to be able to test this library. This would require my testing code to make a call to a working server that returns JSON. Does anyone know of a server that is suitable for this purpose?

Was it helpful?

Solution

There is a great server located at http://echo.jsontest.com that does precisely this. You can even determine the output by changing the URI you call.

For example, the http://echo.jsontest.com/key/value URI returns this:

{"key": "value"}

And the http://echo.jsontest.com/key/value/otherkey/othervalue URI returns:

{
   "otherkey": "othervalue",
   "key": "value"
}

The server is also very fast, ideal for testing purposes.

OTHER TIPS

You can test your lib with facebook or twitter public api. For exemple : http://search.twitter.com/search.json?q=blue%20angels will return a json object.

Doc here : https://dev.twitter.com/docs/api/1/get/search

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top