HTTP - dejanu/linux GitHub Wiki

**Hypertext Transfer Protocol **

Connectionless and Stateless protocol build on top of TCP

Connectionless = the client makes a request and then disconnects from the server and when the response is ready the server re-establish the connection
Stateless = each request/response transaction is treated independently , cookies and sessions are used to track the state, clientul si server-ul stiu unul despre altul pe durata unui request?

base


HTTP message consist of one ore more headers, each on separate line, followed by a blank line.

HTTP methods:

  1. GET
  1. POST
  • create or update resource on server (mostly CREATE);
  • the data is send in the body of the HTTP request;
  • the parameters can be send in the url query and in the body of the HTTP request;
  • "Resend or Leave Page" - browsers do not reissue POST request
  • NON-IDEMPOTENT (creates the same resource multiple times, eg contact form)
  • idempotent = HTTP method that can be called many times , and has the same outcome each time f(f(x)) = f(x)
  1. PUT
  • create or update resource on server (mostly UPDATE);
  • IDEMPOTENT (always returns the same result)
  1. PATH
  • applies partial modification to the resource on the server (takes the fields you gave it and assumes that they are the one to change)
  • NON-IDEMPOTENT