HTTP


Förkortningar
- IETF - Internet Engineering Task Force
- HTTP - HyperText Transfer Protocol
- HSTS - HTTP Strict Transport Security
- SOAP - Simple Object Access Protocol
- HLS - HTTP Live Streaming
- DASH - Dynamic Adaptive Streaming over HTTP
- MPD - Media Presentation Description
- BA - Basic authentication
RFC
Delar
header
Access-Control-Request-Method

Protokoll
http://
Port
80

Med hjälp av funktioner från http kan du manipulera information som skickas från webbservern till webbläsaren, innan något annat har skrivits ut. Det behövs ingen installation för att använda dessa funktioner...
Metoder
Operationer
GET
- The GET method requests 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.
Statuskoder
Information
- 100Continue
- 101Switching Protocols
- 103Checkpoint
Successful
- 200OK
- 201Created
- 202Accepted
- 203Non-Authoritative Information
- 204No Content
- 205Reset Content
- 206Partial Content
Redirection
- 300Multiple Choices
- 301Moved Permanently
- 302Found
- 303See Other
- 304Not Modified
- 306Switch Proxy
- 307Temporary Redirect
- 308Resume Incomplete
Client error
- 400Bad Request
- 401Unauthorized
- 402Payment Required
- 403Forbidden
- 404Not Found
- 405Method Not Allowed
- 406Not Acceptable
- 407Proxy Authentication Required
- 408Request Timeout
- 409Conflict
- 410Gone
- 411Length Required
- 412Precondition Failed
- 413Request Entity Too Large
- 414Request-URI Too Long
- 415Unsupported Media Type
- 416Requested Range Not Satisfiable
- 417Expectation Failed
Server error
- 500Internal Server Error
- 501Not Implemented
- 502Bad Gateway
- 503Service Unavailable
- 504Gateway Timeout
- 505HTTP Version Not Supported
- 511Network Authentication Required
Påskägg
- 418I'm a teapot

API

Program
Exempel på Basic authentication (BA)

Liknande
- HTCPCP
- HTTPS
- FTP

Kod för HTTP-status i AJAX med JavaScript
xhr.status
HTTP-status i AJAX med JavaScript
xhr.statusText
Sätt status-kod för HTTP-status i PHP
http_response_code(200);
Visa status-kod för en URL med Electron.js
request = net.request('https://sökmotorn.se')
request.on('response', (response) => {
console.log(response.statusCode)
})
Länkar

Variabler i PHP
$_SERVER['HTTPS']
$_SERVER['REDIRECT_HTTPS']

