Questions tagged [http-response]
The http-response tag has no summary.
67 questions
1 vote
1 answer
509 views
How to handle different json response for the same api rest endpoint and different http status
I have an endpoint similar to GET ../produtcs/123 where 123 stands for an ID. The REST service response with either status 200 and a json object A {"deliveryData": {"status": 200, ...
4 votes
2 answers
6k views
What's the proper response when I try to update an existing entity but with not found parent ID
I have an update API (PUT/PATCH) entity/{id} to update a certain entity in my DB. Let's say: entity { id: number, // Primary key, unique, not null content: text, parentId: number // Foreign key, ...
4 votes
3 answers
1k views
Error or not error?
I need to implement the following scenarios at the server: User sent too many answers in a given amount of time, for example, it can't submit more than 3 posts within an hour. User sent answer with ...
-2 votes
2 answers
3k views
Which HTTP status to return if a downstream service I depend on returned 500 error
My service B is part of a chain of services and calls a downstream service C. A --> B --> C Service C is returning HTTP 500 errors for any error it faced, including bad requests or input ...
1 vote
3 answers
4k views
Is a 422 response ever appropriate for a GET request?
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422 The HyperText Transfer Protocol (HTTP) 422 Unprocessable Entity response status code indicates that the server understands the content ...
-1 votes
1 answer
743 views
Should I use http status code 402 in my api specification for api methods that allow payment?
According to the MDN the http protocol has the 402 status code: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses And is used for methods that require payment. Also RFC ...
-1 votes
2 answers
748 views
API: should a problem with data be announced by a HTTP code or in the response body?
After years of (amateur, dirty) personal API development I finally decided to follow some best practices. My problem: the API may have problems, say, retrieving some data. It will gracefully handle ...
5 votes
4 answers
7k views
HTTP POST request status 200 vs 204 vs 404
Our POST API takes in an identifier (let's say deviceId) in order to compute the accuracy of the location we have stored for that device in a DB; the result of that compution is then saved in a ...