spec
spec copied to clipboard
Success/Error handling: Status Codes
Use three simple, common response codes indicating (1) success, (2) failure due to client-side problem, (3) failure due to server-side problem:
- 200 - OK
- 400 - Bad Request
- 500 - Internal Server Error
Sounds good to me (except for the inability to provide messages as you guys mentioned in your JSON-RPC thread).
https://github.com/elimisteve/block-status-code-retriever follows this suggestion. Example: https://github.com/elimisteve/block-status-code-retriever/blob/master/web.go#L58