Origin

The Origin HyperText Transfer Protocol (HTTP) request header indicates the origin of the request. This header does not include any path information. It is similar to the Referer header, but unlike that header, the Origin header does not disclose the whole path.

Note: Basically, browsers add the Origin request header to:

There are some exceptions to the above rules; for example, if a cross-origin GET or HEAD request is made in no-cors mode, the Origin header will not be added.

Header type Request header
Forbidden header name yes

Syntax

Origin: null
Origin: <scheme> "://" <hostname> [ ":" <port> ]

Directives

<scheme>

The protocol that is used. Usually, it is the HTTP protocol or its secured version, HTTPS.

<hostname>

The domain name of the server (for virtual hosting) or the IP.

<port> Optional

TCP port number on which the server is listening. If no port is given, the default port for the service requested (e.g., "80" for an HTTP URL) is implied.

Examples

Origin: https://developer.mozilla.org

Specifications

Specification
The Web Origin Concept
# section-7
Fetch Standard (Fetch)
# origin-header

Browser compatibility

BCD tables only load in the browser

See also