You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
Code 404 means "The server has not found anything matching the Request-URI." When a requested block does not exist, the Request-URI, namely /v1/chain/get_block is still correct. Only the data payload is incorrect.
Per RFC 4918, the most applicable code is 422. However in proposed standard changes, RFC 7231 revises the definition of code 400, making that the best choice.
Given that HTTP/1.1 incorporated some of 7231, I would prefer to see code 400.
Code 404 means "The server has not found anything matching the Request-URI."
I could not find this in any of the RFC. Instead I could find this "The 404 (Not Found) status code indicates that the origin server did not find a current representation for the target resource or is not willing to disclose that one exists."
According to this definition, the whole request (uri + payload) points to "the target resource", right?
404 (not found) seems more natural in this case, you are looking for something which is not there, it doesn't exist, not because the uri or payload is wrong formatted.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Calling get_block for an unknown block - typically one with a block number greater than the head block number.
curl --request POST --url https://node2.eosphere.io/v1/chain/get_block --data '{"block_num_or_id":"100000000"}'
Returns http result code 500, the correct http result code to return in this situation is 404.
500 indicates an Internal Server Error, 404 "indicates that the origin server did not find a current representation for the target resource"
404 seems to more accurately reflect the reality of asking for a block that does not exist.
The text was updated successfully, but these errors were encountered: