Search code examples
jsontestingdemo

Does anyone know a demo JSON server?


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?


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.