DEV Community

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

Posted on

2 1 1 1 1

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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay