DEV Community

Larissa Bizzi
Larissa Bizzi

Posted on

About HTTP : request, response and methods

I am studying the RESTful API development and it begins with some recap about HTTP. Let's talk about it. 😊

5 HTTP common methods (also called HTTP verbs):

  • GET -> retrieves a ressource;
  • POST -> sends data to the server and creates a record;
  • PUT -> updates the whole ressource;
  • PATCH -> partially updates a ressource;
  • DELETE -> deletes a ressource.

A HTTP request includes:

  • version type;
  • URL;
  • HTTP method;
  • request headers (ex. cookies, user-agents, referrers);
  • body (optional).

The HTTP response contains the resource that was requested. It also contains information like the length of the content, the content type, and headers like cookies. It also contains ETags, the time when the content was last modified, and finally, the response also contains some special numerical codes called HTTP status codes.

Top comments (0)