Repaso
EspaƱol
Backend & APIsCoreAPI-32

Which list contains the main parts of an HTTP request?

Options

  1. Method, URL, headers, optional body (Correct option)
  2. Port, cookie, password, session id
  3. HTML, CSS, JavaScript and images
  4. Status code, reason phrase and body only

Answer

Method, URL, headers, optional body

Why

An HTTP request has:

  • Method: what to do (GET, POST, PUT, PATCH, DELETE).
  • URL: which resource (/users/42).
  • Headers: extra information (Authorization, Content-Type).
  • Body (optional): data you send, usually JSON, for POST/PUT/PATCH.

The RESPONSE has a status code, headers and a body.

Remember

Request = method + URL + headers + body.

Key terms

Practice this question in Repaso