Vous êtes sur la page 1sur 3

HTTP request methods

HTTP defines a set of request methods to indicate the desired action to be performed for a given resource. Although they can
also be nouns, these request methods are sometimes referred as HTTP verbs. Each of them implements a different semantic,
but some common features are shared by a group of them: e.g. a request method can be safe, idempotent, or cacheable.
GET
The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.
HEAD
The HEAD method asks for a response identical to that of a GET request, but without the response body.
POST
The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on
the server.
PUT
The PUT method replaces all current representations of the target resource with the request payload.
DELETE
The DELETE method deletes the specified resource.
CONNECT
The CONNECT method establishes a tunnel to the server identified by the target resource.
OPTIONS
The OPTIONS method is used to describe the communication options for the target resource.
TRACE
The TRACE method performs a message loop-back test along the path to the target resource.
PATCH
The PATCH method is used to apply partial modifications to a resource.

HTTP status code

HTTP response status codes indicate whether a specific HTTP request has been successfully completed.
Responses are grouped in five classes:

Informational responses (100–199),

Successful responses (200–299),

Redirects (300–399),

Client errors (400–499),

and Server errors (500–599).

LocalStorage
Stores data with no expiration date, and gets cleared only through JavaScript, or
clearing the Browser cache / Locally Stored Data
 Storage limit is the maximum amongst the three
SessionStorage
 The sessionStorage object stores data only for a session, meaning that
the data is stored until the browser (or tab) is closed.
 Data is never transferred to the server.
 Storage limit is larger than a cookie (at least 5MB).
Cookie
 Stores data that has to be sent back to the server with subsequent requests.
Its expiration varies based on the type and the expiration duration can be set
from either server-side or client-side (normally from server-side).
 Cookies are primarily for server-side reading (can also be read on client-side),
localStorage and sessionStorage can only be read on client-side.
 Size must be less than 4KB.
 Cookies can be made secure by setting the httpOnly flag as true for that
cookie. This prevents client-side access to that cookie

URLs
At the heart of web communications is the request message, which are sent via Uniform
Resource Locators (URLs). I'm sure you are already familiar with URLs, but for completeness
sake, I'll include it here. URLs have a simple structure that consists of the following
components:

The protocol is typically http , but it can also be https for secure communications. The
default port is 80 , but one can be set explicitly, as illustrated in the above image. The
resource path is the local path to the resource on the server.

general-header = Cache-Control

| Connection

| Date

| Pragma

| Trailer

| Transfer-Encoding

| Upgrade

| Via

| Warning

request-header = Accept
| Accept-Charset
| Accept-Encoding
| Accept-Language
| Authorization
| Expect
| From
| Host
| If-Match
| If-Modified-Since
| If-None-Match
| If-Range
| If-Unmodified-Since
| Max-Forwards
| Proxy-Authorization
| Range
| Referer
| TE
| User-Agent
response-header= Accept-Ranges

| Age

| ETag

| Location

| Proxy-Authenticate

| Retry-After

| Server

| Vary

| WWW-Authenticate

Vous aimerez peut-être aussi