DEV Community

Gabriel Valin
Gabriel Valin

Posted on

HTTP - Verbs, HTTP codes & Request Params

Verbs

  • GET - Reading infos
  • POST - Create infos
  • PUT - Update Infos
  • PATCH - Update PARTIAL info (example: avatar from user)
  • DELETE - Delete infos

HTTP - Status Code

  • 1xx - Informative: processing..
  • 2xx - Confirmation:
    • 200: Request success
    • 201: Created - AFTER REQUEST POST
  • 3xx - Redirect:
    • 301: Moved Permanently
    • 302: Moved
  • 4xx - Client Error
    • 400: Bad Request
    • 401: Unauthorized
    • 403: Forbidden
    • 404: Not Found
    • 422: Unprocessable Entity
  • 5xx - Server Error
    • 500: Internal Server Error
    • 502: Bad Gateway

Request Params

  • Header Params: Token, authorization, cors
  • Query Params: key,value,separator (page=28&)
  • Route Params: /products/{id}
  • Body Params: { name: 'john doe', last_name: 'stewie' }

Latest comments (0)