HTTP status codes

Status codes used at the RPC layer are simple:

  • 200 - The request was processed or is being processed (streaming)

  • 500 - RPC endpoint returned an error

  • 400 - Malformed RPC, argument type error, etc

  • 403 - RPC call forbidden

  • 404 - RPC endpoint doesn't exist

  • 405 - HTTP Method Not Allowed

Status code 500 means that the function does exist, but IPFS was not able to fulfil the request because of an error. To know that reason, you have to look at the error message that is usually returned with the body of the response (if no error, check the daemon logs).

Streaming endpoints fail as above, unless they have started streaming. That means they will have sent a 200 status code already. If an error happens during the stream, it will be included in a Trailer response header (some endpoints may additionally include an error in the last streamed object).

A 405 error may mean that you are using the wrong HTTP method (i.e. GET instead of POST), and a 403 error occurs in a browser due to Origin / CORS.

Last updated