I have a server that returns a 401 when the Authorization header is missing, but I also like to return a JSON body with a little more information as to what went wrong (ie. the header is flat out missing or the credentials aren't being sent in the correct way, with a link to the documentation), and superagent allows you to output the `response.body` in the `end()` method callback.
I think of superagent as the requests[1] of js. In fact, I usually require it under the name requests as they feel so similar.
0: https://github.com/visionmedia/superagent
1: http://docs.python-requests.org/en/latest/
EDIT: link formatting
http://bugs.jquery.com/ticket/7868
http://stackoverflow.com/questions/5884286/jquery-ajax-with-...
I'm not sure what this is, but it could be some sort of expectation where all responses are expected to get a 200 along with wrappers like this:
{"status":"error","reason":"not found"}
{"status":"success","response":{...}}
And client-side devs using jQuery (for example) correspondingly expect to handle error conditions in the "success" callback instead of the "error" callback.When someone used to doing things like the above talks to someone more accustomed to RESTish ways of doing things, quite a bit could get lost in translation and communication often completely breaks down.