DEV Community

Cover image for important status code to be known as API developer
Salman Asu
Salman Asu

Posted on

important status code to be known as API developer

success
200 ok

  • use with get method after receiving success response

201 created

  • use with post method when data is add or modify in database

client error
400 bad request

  • use when user send wrong data with payload, parameter or query

401 unauthorize

  • use when unauthorize user or without login user try to access the resources.

403 forbidden

  • use when user is authorize but not have permission to access the resources(admin).

404 page not found

  • use when user try to access invalid route.

server error
500 internal server error

  • when something went wrong with code or server.

*for more refer *

Image description

Top comments (0)