HTML methods Attribute

The obsolete HTML methods attribute was historically associated with links and was intended to provide information about the HTTP methods supported by a linked resource.

Historical Syntax

The methods attribute could be associated with an <a> or <link> element and contain information about HTTP methods available for the linked resource.

<a href="resource.html" methods="GET">View Resource</a>

The attribute described capabilities associated with the linked resource. It did not determine the HTTP method used when an ordinary hyperlink was activated.

Historical Elements

The obsolete methods attribute is associated with the <a> and <link> elements.

Element Historical Purpose
<a> Provided information about HTTP methods supported by the resource identified by the hyperlink.
<link> Provided information about HTTP methods supported by a resource related to the current document.

Historical Use

The methods attribute was intended to describe which HTTP methods a linked resource supported. This information could theoretically help a user agent determine which operations were available for that resource.

For example, a resource might support methods for retrieving information or performing other operations. The attribute supplied descriptive information about those capabilities rather than changing how the link itself worked.

The attribute should not be confused with the current method attribute used by the <form> element. A form's method attribute determines how form data is submitted, while the obsolete methods attribute described methods associated with a linked resource.

Why It Became Obsolete

The methods attribute did not become a useful part of normal webpage linking and is no longer used to describe the capabilities of linked resources.

HTTP provides its own mechanism for discovering communication options supported by a resource. Keeping this information at the HTTP level avoids placing potentially inaccurate information about a remote resource directly in HTML markup.

Modern Alternative

There is no replacement HTML attribute for methods. Remove the obsolete attribute from the <a> or <link> element.

Historical HTML

<a href="resource.html" methods="GET">View Resource</a>

Modern HTML

<a href="resource.html">View Resource</a>

When software needs to determine which communication options are supported by a resource, the server and client can use HTTP mechanisms such as an OPTIONS request rather than an HTML attribute.

OPTIONS /resource.html HTTP/1.1
Host: www.example.com

The server can respond with information about the methods and communication options it supports. This occurs through HTTP rather than through the webpage's HTML markup.

Legacy Browser Support

The methods attribute is a legacy linking feature and should not be relied upon for determining which HTTP methods a resource supports.

Modern webpages should omit the attribute. Applications that need information about a resource's supported communication options should use appropriate HTTP mechanisms instead.

For additional information about historical browser compatibility, visit Can I Use? . Search for the HTML element or attribute you want to check. Search results can include related HTML features, element attributes, APIs, and other technologies, so select the result that most closely matches the legacy feature you are researching.

Other HTML attributes associated with links or HTTP behavior include:

  • href - Specifies the URL of a resource for elements such as <a> and <link>.
  • rel - Describes the relationship between the current document and a linked resource.
  • rev - An obsolete attribute historically used to describe a reverse relationship between linked resources.
  • urn - An obsolete attribute historically associated with persistent identifiers for linked resources.
  • method - Specifies the HTTP method used when submitting a <form> and should not be confused with the obsolete methods attribute.

Specifications

The methods attribute on <a> and <link> elements is obsolete and must not be used by authors. The HTML Living Standard recommends using the HTTP OPTIONS feature instead. See the WHATWG HTML Living Standard for information about obsolete and non-conforming features.