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)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay