Cheatsheet: Difference between revisions

Line 410:
 
== HTTP Headers ==
{|class="wikitable"
 
|-
Set-cookie:
! Header !! Uses
Location: 1) Used to ask a web browser to load a different web page:
|-
Client request:
|Set-cookie: ||
GET /index.html HTTP/1.1
|-
Host: www.example.com
|Location ||1) Used to ask a web browser to load a different web page<br/>Client request:<br/>''GET /index.html HTTP/1.1''<br/>''Host: www.example.com''<br/>Server response:<br/>''HTTP/1.1 302 Found''<br/>''Location: http://www.example.org/index.php.''<br/>
Server response:
2) To provide info about location of a newly created resource, the Location header should be sent with an HTTP status code of 201 or 202.
HTTP/1.1 302 Found
|-
Location: http://www.example.org/index.php
|Host: ||The host Header tells the webserver which virtual host to use if same virtual host is using several aliases
2) To provide info about location of a newly created resource, the Location header should be sent with an HTTP status code of 201 or 202.
|-
Host: The host Header tells the webserver which virtual host to use if same virtual host is using several aliases
|Accept:||
|-
|User-Agent:||
content-type:
|-
content-length:
|content-type:||
date:
|-
expires:
|content-length:||
Authorization: Basic access authentication is used to provide a user name and password when making a request.
|-
Credentials are the base64 encoding of id and password joined by a single colon
|date:||
Base64-encoding of 'Aladdin:OpenSesame' is 'QWxhZGRpbjpPcGVuU2VzYW1l'
|-
Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l
|expires:||
https://Aladdin:OpenSesame@www.example.com/index.html ==> This will not ask for the credentials;deprecated now
|-
Referrer: When a user clicks a hyperlink in a web browser, the browser sends a request to the server holding the destination webpage.
|Authorization||Basic access authentication is used to provide a user name and password when making a request.<br/>Credentials are the base64 encoding of id and password joined by a single colon<br/>Base64-encoding of 'Aladdin:OpenSesame' is 'QWxhZGRpbjpPcGVuU2VzYW1l'<br/>''Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l''<br/>''https://Aladdin:OpenSesame@www.example.com/index.html'' ==> This will not ask for the credentials; deprecated now
The request may include the referer field, which indicates the last page the user was on (the one where they clicked the link).
|-
|Referrer: ||When a user clicks a hyperlink in a web browser, the browser sends a request to the server holding the destination webpage. <br/>
The request may include the referer field, which indicates the last page the user was on (the one where they clicked the link).
|-
|X-Forwarded-For (XFF)||Common method for identifying the originating IP address of a client connecting to a web server through an HTTP proxy or load balancer.
|}
 
= FTP =