Tag Info

Hot answers tagged

6

The successful creation of the task to do whatever was successful. This means that one should be looking in the 2xx block of the response codes. In this block one jumps out as the correct answer quite quickly: 202 Accepted The request has been accepted for processing, but the processing has not been completed. The request might or might not ...


3

404 is perfectly fine for this use case. 4xx status codes are client error codes, so browser treats them as such, and that is perfectly fine too. Another kind of APIs (e.g. JSON-RPC) use different approaches, but since you're going RESTful, do not change response code just to make console output look pretty - it is not a use case, users are not supposed to ...


1

Like many important ideas, the concept is more important than the implementation detail. You could write a web-service that simply used HTML. This wouldn't be a great idea — using a JSON parser on { customerList: [{ id: 4, name: "John Doe", ... }, ... ] } will get you off the ground a lot faster than using an HTML parser on ...


1

XML and JSON are more flexible than HTML, because they're designed specifically to handle data in an agnostic way. Yes, you can parse HTML and do something with it, but it's not really designed for that; it's designed for displaying UI. XML and JSON, on the other hand, can be consumed by a frontend like Angular, and used to display data in an HTML page. ...


1

Use 200 Ok The setup you propose is common with a service orientated architecture (SOA). When using asynchronous messaging you typically have a flow like: --> Request <-- Delivery acknowledgement <-- Process acknowledgement --> Delivery acknowledgement It is typical to use 200 Ok for a successful delivery acknowledgement. I would expect this ...


1

You miss the opportunity to report errors that may occur while processing the message. That way the consumer of your service can never be sure if the call was successful.



Only top voted, non community-wiki answers of a minimum length are eligible