HTTP responses as a service
mock.isssues.com
mock.isssues.com
http://www.mocky.io/, http://ivanzuzak.info/urlecho/, and in some cases: http://hang.nodester.com/
https://tools.ietf.org/html/draft-tbray-http-legally-restric...
I wish people would stop trying to make response codes into more than they are. Rest does not entail webdav, and without webdav there are not enough semantics to try to do the kinds of things people typically try to make response codes do.
If you are implementing webdav, call it that and stick to the spec, don't just hack a middle ground and pretend you are designing the API properly.
I think the HTTP codes should be used simply to reflect the transport (in this case HTTP) and any application level stuff should be returned in a systematic way inside the response body. Which means any API call to a valid resource that the user has access to should return a 200.
Then clients can safely assume that if they get a 4xx or 5xx something is breaking, and if it's a 200 then look at the body and deal with the actual response.
What's the good parts of WebDAV and how do they help me make decent RESTful APIs?
http://datatracker.ietf.org/doc/rfc4918/?include_text=1
I'm not a big fan of this practice b/c I've found that as APIs evolve the status codes end up having application specific meaning rather than standard, protocol specific meaning.
Bottom line, I think that unless your API very closely resembles the kind of thing WebDav is designed to do, it's better to just do a simple REST version with core HTTP status codes and handle any standardized response semantics inside the response body.
IIRC it also supports simulated response delays. You'll never know the difference!
That being said, I can think of some cases where this service would be really useful, such as one of tests on live systems for example.
Result of
curl -i http://mock.isssues.com/timeout
here: http://pastebin.com/nM1VTYwgDid your webserver timeout on your CGI? :)
It could help to link to some explanation/section in the RFC from the front page error code. Apart from that, this is very nice and potentially useful, thank you very much.
For completeness' sake, also 3xx redirects could be implemented, redirecting to http://mock.isssues.com/200 for example.