13

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?

4

2 回答 2

27

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.

于 2013-03-30T10:46:51.790 回答
0

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

于 2013-03-30T10:55:40.143 回答