The Wayback Machine - https://web.archive.org/web/20240708033235/https://www.geeksforgeeks.org/http-headers-link/
Open In App

HTTP headers | Link

Last Updated : 23 Jun, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

For serialising one or more links in HTTP headers, the HTTP Link header-field is used. It allows the server to point an interested client to another resource containing metadata about the requested resource. It is semantically equivalent to the HTML <link> element. 
Syntax: 

Link: <uri-reference>; param1="value1" param2="value2"

Directive: This header accept a single directive as mentioned above and described below. The link header contains parameters, which are separated with ; and are equivalent to attributes of the <link> element. 

  • <uri-reference>: The URI reference, must be enclosed between < and >. 

Examples: 

  • This means that more information about the requested resource is available in the resource whose relative URI is https://www.geeksforgeeks.org/.
Link: <https://www.geeksforgeeks.org/>; rel="preconnect"
  • The URI must be enclosed between < and >. So, this is not a good way to write.
Link:https://www.geeksforgeeks.org/; rel="preconnect"

Specifying multiple links:  You can specify multiple links separated by commas. 

Example: 

Link: <https://example.one.com>; rel="preconnect", 
<https://example.two.com>; rel="preconnect", 
<https://example.three.com>; rel="preconnect"

Typical uses are: 

  • A map of different language, content-type and version-specific URIs
  • Licensing, such as Creative Commons
  • Information about how to edit the file
  • Policy information about appropriate use and/or distribution of the data

Supported Browsers: The browser supported by HTTP-header  link are unknown till now.
 



Similar Reads

HTTP headers | Access-Control-Expose-Headers
The HTTP Access-Control-Expose-Headers header is a response header that is used to expose the headers that have been mentioned in it. By default 6 response headers are already exposed which are known as CORS-safelisted response headers. They are namely- Cache-Control, Content-Language, Content-Type, Expires, Last-Modified, Pragma. Syntax: Access-Co
1 min read
HTTP headers | Access-Control-Allow-Headers.
The HTTP Access-Control-Allow-Headers header is a response-type header that is used to indicate the HTTP headers. It can be used during a request and is used in response to a CORS preflight request, that checks to see if the CORS protocol is understood and a server is aware using specific methods and headers, which includes the Access-Control-Reque
1 min read
HTTP headers | Access-Control-Request-Headers
Access-Control-Request-Headers is a request-type header used by browsers that contains information about the different HTTP headers that will be sent by the client in the ensuing request. Whenever a client initiates a request to a server, the browser checks if the request needs a CORS preflight or not. In case a CORS preflight request is required,
2 min read
HTTP headers | Location
The HTTP Location header is a response header that is used under 2 circumstances to ask a browser to redirect a URL (status code 3xx) or provide information about the location of a newly created resource (status code of 201). Its usage is often confused with another HTTP Header which is HTTP Content-Location header. The main difference between them
2 min read
HTTP headers | User-Agent
The HTTP headers User-Agent is a request header that allows a characteristic string that allows network protocol peers to identify the Operating System and Browser of the web-server. Your browser sends the user agent to every website you connect to. There is no conventional way of writing a user agent string as different browsers use different form
2 min read
HTTP headers | Save-Data
The Save-Data is a HTTP request-type header. It is used to indicate whether the client wants to turn on data saving mode or not. Here, data usage is measured in terms of cost and performance. The role of any browser is to provide optimized user experience by providing the highest possible level of performance in a minimal amount of cost. Save-Data:
2 min read
HTTP headers | Content-Type
The Content-Type header is used to indicate the media type of the resource. The media type is a string sent along with the file indicating the format of the file. For example, for image file its media type will be like image/png or image/jpg, etc. In response, it tells about the type of returned content, to the client. The browser gets to know abou
3 min read
HTTP headers | X-Forwarded-Proto
The HTTP headers are used to communicate between client and server. HTTP headers let the client and server pass additional information with an HTTP request or response. X-Forwarded-Proto (XPF) header is used to identifying the protocol that the client used to connect with a proxy or load balancer. It can be HTTP or HTTPS. Your server access log usu
2 min read
HTTP headers | X-XSS-Protection
HTTP headers are used to pass additional information with HTTP response or HTTP requests. The X-XSS-Protection in HTTP header is a feature that stops a page from loading when it detects XSS attacks. This feature is becoming unnecessary with increasing content-security-policy of sites. XSS attacks: The XSS stands for Cross-site Scripting. In this at
2 min read
HTTP headers | X-Frame-Options
HTTP headers are used to pass additional information with HTTP responses or HTTP requests. The X-Frame-Options is used to prevent the site from clickjacking attacks. It defines whether or not a browser should be allowed to render a page in a &lt;frame&gt;, &lt;iframe&gt;, &lt;embed&gt;, or &lt;object&gt;. The frame-ancestors directive present in Co
2 min read
three90RightbarBannerImg