HTTP reference
Search HTTP status codes, headers, MIME types and CSP directives.
Status codes 84
Informational100ContinueThe server has received the request headers and the client should go on to send the body. It is an interim response; the final status follows.
Typical use: Sent after a client asks with
Expect: 100-continue, so a large upload is not sent to a server that would reject it anyway.
Informational101Switching ProtocolsThe server agrees to the client’s
Upgraderequest and switches the connection to the protocol named in its ownUpgradeheader.Typical use: The handshake for WebSocket connections (and, historically, h2c upgrades).
Informational102ProcessingAn interim response from WebDAV telling the client that the server has accepted the full request but has not finished it, so the client should not time out.
Typical use: Long-running WebDAV operations; rarely used today and dropped from the later WebDAV specification.
Informational103Early HintsAn interim response carrying headers, usually
Link, that the client can act on while the server is still preparing the final response.Typical use: Lets browsers preload or preconnect to critical CSS, fonts and origins while the HTML is being generated.
Success200OKThe request succeeded. What the body holds depends on the method: the resource for GET, the result of the action for POST, nothing for HEAD.
Typical use: The default success response for pages, API reads and most actions that return a body.
Success201CreatedThe request succeeded and created one or more new resources. The
Locationheader, if present, points at the main new resource.Typical use: A successful POST or PUT that creates a record in a REST API.
Success202AcceptedThe request has been accepted for processing, but processing is not complete and may still fail. There is no way to send the final outcome later in the same response.
Typical use: Queued or asynchronous jobs; the body often links to a status endpoint to poll.
Success203Non-Authoritative InformationThe request succeeded, but a transforming proxy has changed the content from the origin server’s 200 response.
Typical use: Proxies that rewrite or annotate responses; seldom seen in practice.
Success204No ContentThe request succeeded and there is no content to send. The response cannot have a body; headers such as
ETagstill apply.Typical use: Successful DELETE or PUT calls, saves that need no reply, and CORS preflight responses.
Success205Reset ContentThe request succeeded and the client should reset the document view that sent it, for example clear a form.
Typical use: Data entry forms that should be emptied after submission; browsers largely ignore it.
Success206Partial ContentThe server is sending only the part of the resource asked for in the
Rangeheader, described byContent-Range(or a multipart/byteranges body).Typical use: Resuming downloads, seeking in audio and video, and parallel chunked downloads.
Success207Multi-StatusThe body is an XML document with separate status codes for several resources or operations.
Typical use: WebDAV operations such as PROPFIND that act on many resources at once.
Success208Already ReportedInside a WebDAV multi-status response, the members of this binding were already listed earlier and are not repeated.
Typical use: WebDAV binding extensions, to avoid listing the same collection twice.
Success226IM UsedThe server fulfilled a GET and the response is the result of one or more instance manipulations, such as a delta, applied to the current instance.
Typical use: HTTP delta encoding; almost never used.
Redirection300Multiple ChoicesThe resource has several representations, each with its own location, and the client or user should pick one.
Typical use: Rare; content negotiation is usually done without asking the user.
Redirection301Moved PermanentlyThe resource has a new permanent URL, given in
Location. Clients may change POST to GET when following it, for historical reasons.Typical use: Permanent URL changes and HTTP to HTTPS redirects; search engines move ranking to the new URL.
Redirection302FoundThe resource is temporarily at another URL, given in
Location. Clients may change POST to GET when following it.Typical use: Temporary redirects, login redirects and the classic redirect after a form post.
Redirection303See OtherThe response to this request is at another URL, which the client should fetch with GET, whatever the original method was.
Typical use: The Post/Redirect/Get pattern: send the user to a result page after a form submission.
Redirection304Not ModifiedA conditional GET or HEAD found that the resource has not changed, so the client can use its cached copy. The response has no body.
Typical use: Cache revalidation with
If-None-MatchorIf-Modified-Since.
RedirectionDeprecated305Use ProxyDefined in an earlier HTTP specification to ask the client to repeat the request through a proxy.
Typical use: Not used; browsers ignore it for security reasons.
RedirectionDeprecated306(Unused)Was “Switch Proxy” in a draft specification. The code is reserved and no longer has a meaning.
Typical use: Never sent.
Redirection307Temporary RedirectThe resource is temporarily at the URL in
Location, and the client must repeat the request there with the same method and body.Typical use: Temporary redirects that must keep POST as POST, and browser-internal HSTS upgrades.
Redirection308Permanent RedirectThe resource has a new permanent URL in
Location, and the client must repeat the request there with the same method and body.Typical use: Permanent moves of API endpoints or any URL that receives POST, PUT or DELETE.
Client error400Bad RequestThe server cannot or will not process the request because of something it sees as a client error, such as malformed syntax or invalid framing.
Typical use: Malformed JSON, missing required parameters and general validation failures.
Client error401UnauthorizedThe request lacks valid authentication credentials. The response must include a
WWW-Authenticateheader with a challenge saying how to authenticate.Typical use: Missing or expired tokens and wrong passwords; the client should sign in and retry.
Client error402Payment RequiredReserved for future use. No standard behaviour is defined.
Typical use: Some APIs and SaaS products use it for unpaid accounts or exhausted quotas.
Client error403ForbiddenThe server understood the request but refuses to fulfil it. Unlike 401, authenticating again will not help.
Typical use: Insufficient permissions, blocked IP addresses and CSRF check failures.
Client error404Not FoundThe server has no current representation of the target resource, or will not say that one exists. It says nothing about whether this is temporary.
Typical use: Unknown URLs and missing records; also used instead of 403 to hide that a resource exists.
Client error405Method Not AllowedThe resource exists but does not support the request method. The response must include an
Allowheader listing the methods it does support.Typical use: POST to a read-only endpoint, or DELETE where deletion is not offered.
Client error406Not AcceptableThe resource has no representation that matches the client’s
Accept,Accept-LanguageorAccept-Encodingheaders, and the server will not send a default.Typical use: Strict content negotiation in APIs; most servers send a default representation instead.
Headers 100
RequestAcceptMedia types the client can handle, in order of preference with optional
qweights.Accept: text/html,application/xhtml+xml;q=0.9,*/*;q=0.8
ResponseAccept-CHClient hints the server wants the browser to send on later requests.
Accept-CH: Sec-CH-UA-Platform-Version, Sec-CH-UA-Model
RequestAccept-EncodingContent codings (compression) the client understands.
Accept-Encoding: gzip, deflate, br, zstdNote: Servers that compress based on it should send
Vary: Accept-Encoding.
RequestAccept-LanguageNatural languages the user prefers, as BCP 47 tags with optional weights.
Accept-Language: en-GB,en;q=0.9,de;q=0.7
ResponseAccept-RangesSays whether the server supports range requests for this resource, and in which unit.
Accept-Ranges: bytes
ResponseAccess-Control-Allow-CredentialsLets the page read a cross-origin response to a request made with credentials (cookies, HTTP auth).
Access-Control-Allow-Credentials: trueNote: With
true,Access-Control-Allow-Originmust name the origin;*is refused.
ResponseAccess-Control-Allow-HeadersRequest headers allowed in the actual request, sent in reply to a preflight.
Access-Control-Allow-Headers: Content-Type, AuthorizationNote:
*works only for requests without credentials and never coversAuthorization.
ResponseAccess-Control-Allow-MethodsMethods allowed in the actual request, sent in reply to a preflight.
Access-Control-Allow-Methods: GET, POST, PUT, DELETE
ResponseAccess-Control-Allow-OriginWhich origin may read the response: one origin,
*ornull.Access-Control-Allow-Origin: https://app.example.comNote: Only one origin is allowed; to allow several, echo a vetted request
Originand sendVary: Origin. Never echo every origin together with credentials.
ResponseAccess-Control-Expose-HeadersResponse headers, beyond the safelisted ones, that scripts may read.
Access-Control-Expose-Headers: Content-Range, X-Request-Id
ResponseAccess-Control-Max-AgeHow many seconds the browser may cache a preflight result.
Access-Control-Max-Age: 600Note: Browsers cap it: Chromium at 2 hours, Firefox at 24 hours.
RequestAccess-Control-Request-HeadersSent in a preflight: the non-safelisted headers the actual request will use.
Access-Control-Request-Headers: content-type, authorization
RequestAccess-Control-Request-MethodSent in a preflight: the method the actual request will use.
Access-Control-Request-Method: PUT
ResponseAgeSeconds since the response was generated or revalidated at the origin, added by caches.
Age: 3600
ResponseAllowMethods the resource supports. Required with 405 Method Not Allowed.
Allow: GET, HEAD, POST
ResponseAlt-SvcAdvertises other protocols or endpoints that serve the same origin, such as HTTP/3.
Alt-Svc: h3=":443"; ma=86400
RequestAuthorizationCredentials that authenticate the client with the origin server.
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9…Note: Not a CORS-safelisted header: cross-origin requests that send it need a preflight. Browsers drop it on cross-origin redirects.
Request and responseCache-ControlCaching directives:
max-age,no-cache(revalidate first),no-store(never store),private,public,immutable,stale-while-revalidateand more.Cache-Control: public, max-age=31536000, immutableNote: Use
no-storefor responses with personal data;no-cachestill stores the response.
ResponseCache-StatusHow each cache along the path handled the request: hit, forwarded, stored, and why.
Cache-Status: ExampleCDN; hit; ttl=300
ResponseCDN-Cache-ControlCache directives aimed only at CDNs, overriding
Cache-Controlfor them.CDN-Cache-Control: max-age=600
ResponseClear-Site-DataTells the browser to clear cookies, storage, cache or execution contexts for the origin.
Clear-Site-Data: "cache", "cookies", "storage"Note: Useful on sign-out. Only honoured over HTTPS.
Request and responseConnectionOptions for the current connection, such as
close, and the hop-by-hop headers that must not be forwarded.Connection: closeNote: Forbidden in HTTP/2 and HTTP/3.
ResponseContent-DispositionWhether the body is shown inline or downloaded as an attachment, and the suggested file name.
Content-Disposition: attachment; filename="report.pdf"; filename*=UTF-8''r%C3%A9sum%C3%A9.pdfNote: Also used inside multipart/form-data parts to name each field.
Request and responseContent-EncodingCompression applied to the body, which the recipient must undo.
Content-Encoding: br
Request and responseContent-LanguageNatural language of the intended audience of the content.
Content-Language: de-DE
Request and responseContent-LengthSize of the body in bytes.
Content-Length: 3495
ResponseContent-LocationA URL for the specific representation returned, when it differs from the request URL.
Content-Location: /documents/foo.json
ResponseContent-RangeWhich part of the full resource a partial body holds, and the full size.
Content-Range: bytes 200-1023/146515
ResponseContent-Security-PolicyRestricts where scripts, styles, images, frames and other resources may load from.
Content-Security-Policy: default-src 'self'; script-src 'self' 'nonce-r4nd0m'; object-src 'none'Note: A strict nonce- or hash-based policy is the main defence in depth against XSS.
ResponseContent-Security-Policy-Report-OnlyReports CSP violations without blocking anything, to test a policy before enforcing it.
Content-Security-Policy-Report-Only: default-src 'self'; report-to csp
MIME types 119
text/htmlHTML document ·
.html.htmtext/cssCascading Style Sheets ·
.csstext/javascriptJavaScript; the official type since RFC 9239 ·
.js.mjstext/plainPlain text ·
.txt.text.logtext/csvComma-separated values ·
.csvtext/tab-separated-valuesTab-separated values ·
.tsvtext/markdownMarkdown ·
.md.markdowntext/calendariCalendar event or calendar ·
.icstext/vcardvCard contact ·
.vcf.vcardtext/xmlXML that is readable as text; prefer application/xml
text/event-streamServer-sent events stream
text/vttWebVTT subtitles and captions ·
.vtttext/rtfRich Text Format ·
.rtftext/x-pythonPython source ·
.pytext/x-cC source ·
.c.htext/x-java-sourceJava source ·
.javatext/x-shShell script ·
.shapplication/jsonJSON ·
.jsonapplication/ld+jsonJSON-LD linked data ·
.jsonldapplication/manifest+jsonWeb app manifest ·
.webmanifestapplication/geo+jsonGeoJSON ·
.geojsonapplication/problem+jsonProblem details for HTTP APIs (RFC 9457)
application/json-patch+jsonJSON Patch (RFC 6902)
application/merge-patch+jsonJSON Merge Patch (RFC 7396)
application/x-ndjsonNewline-delimited JSON ·
.ndjson.jsonlapplication/xmlXML document ·
.xml.xsd.xslapplication/xhtml+xmlXHTML document ·
.xhtmlapplication/atom+xmlAtom feed ·
.atomapplication/rss+xmlRSS feed ·
.rssapplication/yamlYAML (RFC 9512) ·
.yaml.yml
CSP directives 39
Fetch directivedefault-srcFallback for every fetch directive that is not set.
default-src 'self'Note: Start strict (
'none'or'self') and open up per resource type.
Fetch directivescript-srcWhere scripts may load from and whether inline scripts, event handlers and
evalmay run.script-src 'nonce-r4nd0m' 'strict-dynamic'Note: A nonce or hash with
'strict-dynamic'is the recommended strict policy; host allowlists are easy to bypass.
Fetch directivescript-src-elemSources for
<script>elements only, overridingscript-srcfor them.script-src-elem 'self' https://cdn.example.com
Fetch directivescript-src-attrInline event handler attributes such as
onclick.script-src-attr 'none'
Fetch directivestyle-srcWhere style sheets may load from, and whether inline styles may apply.
style-src 'self' 'nonce-r4nd0m'
Fetch directivestyle-src-elem<style>elements and<link rel="stylesheet">.style-src-elem 'self' https://fonts.googleapis.com
Fetch directivestyle-src-attrInline
styleattributes on elements.style-src-attr 'unsafe-inline'
Fetch directiveimg-srcImages and favicons.
img-src 'self' data: https://images.example.com
Fetch directivefont-srcFonts loaded with
@font-face.font-src 'self' https://fonts.gstatic.com
Fetch directiveconnect-srcURLs scripts may contact:
fetch, XHR, WebSocket, EventSource andsendBeacon.connect-src 'self' https://api.example.com wss://live.example.com
Fetch directivemedia-src<audio>,<video>and<track>sources.media-src 'self' https://media.example.com
Fetch directiveobject-src<object>and<embed>plugin content.object-src 'none'Note: Set it to
'none'; plugins are a common bypass.
Fetch directiveframe-srcPages that may load in
<iframe>and<frame>on this page.frame-src https://www.youtube-nocookie.com
Fetch directivechild-srcFrames and workers, when
frame-srcorworker-srcis not set.child-src 'self'
Fetch directiveworker-srcScripts for
Worker,SharedWorkerand service workers.worker-src 'self'
Fetch directivemanifest-srcWeb app manifests.
manifest-src 'self'
Document directivebase-uriURLs allowed in
<base href>, which changes how relative URLs resolve.base-uri 'none'Note: Does not fall back to
default-src; set it, or injected<base>tags can redirect scripts.
Document directivesandboxApplies iframe-style sandbox restrictions to the page, with
allow-*exceptions.sandbox allow-scripts allow-formsNote: Ignored in
<meta>policies and in report-only mode.
Navigation directiveform-actionURLs forms on the page may submit to.
form-action 'self'Note: Does not fall back to
default-src.
Navigation directiveframe-ancestorsWhich pages may embed this one in a frame; protects against clickjacking.
frame-ancestors 'none'Note: Replaces
X-Frame-Options. Ignored in<meta>policies; send it as a header.
Reporting directivereport-toNames a
Reporting-Endpointsgroup that violation reports are sent to.report-to csp
Reporting directiveDeprecatedreport-uriURL that receives violation reports as JSON POST requests.
report-uri https://example.com/csp-reportsNote: Still the only reporting option in some browsers; send it together with
report-to.
Other directiveupgrade-insecure-requestsRewrites the page’s http: subresource and same-site navigation URLs to https: before fetching.
upgrade-insecure-requests
Other directiverequire-trusted-types-forMakes DOM XSS sinks such as
innerHTMLaccept only Trusted Types objects:'script'.require-trusted-types-for 'script'
Other directivetrusted-typesNames the Trusted Types policies the page may create.
trusted-types default dompurify 'allow-duplicates'
Other directiveDeprecatedblock-all-mixed-contentBlocked every http: subresource on an https: page.
block-all-mixed-content
Source expression'self'The page’s own origin (scheme, host and port); also allows the https: and wss: upgrades of it.
default-src 'self'
Source expression'none'Nothing; must be the only value of the directive.
object-src 'none'
Source expression'unsafe-inline'Allows inline
<script>,<style>, event handlers andjavascript:URLs.style-src 'self' 'unsafe-inline'Note: Defeats most XSS protection for scripts. Ignored when a nonce or hash is also present.
Source expression'unsafe-eval'Allows
eval(),new Function()and string arguments tosetTimeout.script-src 'self' 'unsafe-eval'