Link - HTTP | MDN

archived 11 Jul 2023 03:35:58 UTC

Link

The HTTP Link entity-header field provides a means for serializing one or more links in HTTP headers. It is semantically equivalent to the HTML <link> element.

#Syntax

http
Link: <uri-reference>; param1=value1; param2="value2"
<uri-reference>
The URI reference, must be enclosed between < and > and URL encoded.

#Parameters

The link header contains parameters, which are separated with ; and are equivalent to attributes of the <link> element.

#Examples

The URI (absolute or relative) must be enclosed between < and >:
http
Link: <https://example.com>; rel="preconnect"
http
Link: https://bad.example; rel="preconnect"

#Encoding URLs

The URI (absolute or relative) must encode char codes greater than 255:
http
Link: <https://example.com/%E8%8B%97%E6%9D%A1>; rel="preconnect"
http
Link: <https://example.com/苗条>; rel="preconnect"
You can specify multiple links separated by commas, for example:
http
Link: <https://one.example.com>; rel="preconnect", <https://two.example.com>; rel="preconnect", <https://three.example.com>; rel="preconnect"

#Specifications

Specification
Web Linking
# header

#Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
Link

Legend

Tip: you can click/tap on a cell for more information.
Full supportFull support
Compatibility unknownCompatibility unknown
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.

#See also

0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
100%