https://www.w3.org/TR/webmention/ W3C Webmention W3C Recommendation 12 January 2017 This version: https://www.w3.org/TR/2017/REC-webmention-20170112/ Latest published version: https://www.w3.org/TR/webmention/ Latest editor's draft: https://webmention.net/draft/ Test suite: https://webmention.rocks/ Implementation report: https://webmention.net/implementation-reports/ Previous version: https://www.w3.org/TR/2016/PR-webmention-20161101/ Editor: Aaron Parecki Repository: Github Issues Commits Please check the errata for any errors or issues reported since publication. The English version of this specification is the only normative version. Non-normative translations may also be available. Copyright (c) 2017 W3C^(r) (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and permissive document license rules apply. --------------------------------------------------------------------- Abstract Webmention is a simple way to notify any URL when you mention it on your site. From the receiver's perspective, it's a way to request notifications when other sites mention it. Author's Note This section is non-normative. This specification was contributed to the W3C from the IndieWeb community. More history and evolution of Webmention can be found on the IndieWeb wiki. Status of This Document This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https:// www.w3.org/TR/. This document was published by the Social Web Working Group as a Recommendation. If you wish to make comments regarding this document, please send them to public-socialweb@w3.org (subscribe, archives). All comments are welcome. Please see the Working Group's implementation report. This document has been reviewed by W3C Members, by software developers, and by other W3C groups and interested parties, and is endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited from another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web. This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy. W3C expects the functionality specified in this Recommendation will not be affected by changes to Fetch. This document is governed by the 1 September 2015 W3C Process Document. Table of Contents 1. 1. Introduction 1. 1.1 Social Web Working Group 2. 1.2 Background 3. 1.3 Overview 4. 1.4 Protocol Summary 2. 2. Conformance 1. 2.1 Conformance Classes 2. 2.2 Test Suite and Reporting 3. 3. Webmention Protocol 1. 3.1 Sending Webmentions 1. 3.1.1 Create a source document that mentions the target 2. 3.1.2 Sender discovers receiver Webmention endpoint 3. 3.1.3 Sender notifies receiver 4. 3.1.4 Sending Webmentions for updated posts 5. 3.1.5 Sending Webmentions for deleted posts 2. 3.2 Receiving Webmentions 1. 3.2.1 Request Verification 2. 3.2.2 Webmention Verification 3. 3.2.3 Error Responses 4. 3.2.4 Updating existing Webmentions 4. 4. Security Considerations 1. 4.1 Preventing Abuse 2. 4.2 Limits on GET requests 3. 4.3 Avoid sending Webmentions to localhost 4. 4.4 Cross-Site Request Forgery 5. 4.5 Limit access to protected resources 6. 4.6 Security and Privacy Review 5. 5. Other Considerations 1. 5.1 Sending Webmentions from non-HTML content 2. 5.2 Sending Webmentions for large datasets 3. 5.3 Respecting cache headers on discovery 6. 6. IANA Considerations 7. A. URIs for Form-Encoded Properties 8. B. Extensions 1. B.1 Vouch 2. B.2 Salmention 3. B.3 Private Webmention 9. C. Resources 1. C.1 Articles 2. C.2 Implementations 10. D. Acknowledgements 11. E. Change Log 1. E.1 Changes from 01 November PR to REC 12. F. References 1. F.1 Normative references 2. F.2 Informative references 1. Introduction A Webmention is a notification that one URL links to another. For example, Alice writes an interesting post on her blog. Bob then writes a response to her post on his own site, linking back to Alice's original post. Bob's publishing software sends a Webmention to Alice notifying that her article was replied to, and Alice's software can show that reply as a comment on the original post. Sending a Webmention is not limited to blog posts, and can be used for additional kinds of content and responses as well. For example, a response can be an RSVP to an event, an indication that someone "likes" another post, a "bookmark" of another post, and many others. Webmention enables these interactions to happen across different websites, enabling a distributed social web. 1.1 Social Web Working Group This section is non-normative. Webmention is one of several related specifications being produced by the Social Web Working Group. Implementers interested in alternative approaches and complimentary protocols should start by reading the overview document [social-web-protocols]. 1.2 Background This section is non-normative. The Webmention spec began as a simplified version of the [Pingback] spec. Where Pingback required sending the source and target URLs in an XML-RPC payload, Webmention simplified that to a form-encoded payload, which meant it could easily be used in HTML forms, was easier to work with since more tools exist for form-encoded payloads, and was not vulnerable to accidentally exposing other parts of a system's code via XML-RPC. Webmention then continued on to more thoroughly specify the details of sending and verifying the request, and expanded to support sending notifications when a source document was updated or deleted. More information can be found in the Webmention FAQ on the IndieWeb wiki. 1.3 Overview This section is non-normative. A typical Webmention flow is as follows: 1. Alice posts some interesting content on her site (which is set up to receive Webmentions). 2. Bob sees this content and comments about it on his site, linking back to Alice's original post. 3. Using Webmention, Bob's publishing software automatically notifies Alice's server that her post has been linked to by the URL of Bob's post. 4. Alice's publishing software verifies that Bob's post actually contains a mention of her post and then includes this information on her site. 1.4 Protocol Summary This section is non-normative. Webmentions are sent "from" a source URL "to" a target URL to notify the target that it has been mentioned at the source URL. 1. User Aaron writes a post on his blog. 2. User Barnaby writes a post on his blog that links to Aaron's post. 3. After publishing the post (i.e., after it has a URL), Barnaby's server notices the mention of Aaron's post as part of the publishing process. 4. Barnaby's server does Webmention discovery on Aaron's post to find its Webmention endpoint (if not found, process stops). 5. Barnaby's server sends a Webmention notification to Aaron's post's Webmention endpoint with: + source set to Barnaby's post's permalink + target set to Aaron's post's permalink. 6. Aaron's server receives the Webmention. 7. Aaron's server verifies that target in the Webmention is a valid permalink on Aaron's blog (if not, processing stops). 8. Aaron's server verifies that the source in the Webmention (when retrieved, after following redirects [FETCH]) contains a hyperlink to the target (if not, processing stops). 2. Conformance The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", " SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. 2.1 Conformance Classes Webmention implementations are either senders or receivers. This section describes the conformance criteria for both. Listed below are known types of Webmention implementations. Senders A Webmention Sender is an implementation that sends Webmentions. In order for a Sender to send a Webmention, there must first be a document at a URL that is accessible to the Receiver. The conformance criteria for Webmention senders is described in Sending Webmentions Listed below are some known types of Webmention Senders. * Blogging or microblogging software * Plugins for existing CMS software * Browser plugins to send a Webmention from a context menu on behalf of the page you're viewing * Web APIs to offload the Webmention endpoint discovery and Webmention delivery * Proxy services that converts existing social media posts to HTML posts and sends Webmentions Receivers A Webmention Receiver is an implementation that receives Webmentions to one or more target URLs on which the Receiver's Webmention endpoint is advertised. In order to receive a Webmention, there must be a URL that advertises the Receiver's Webmention endpoint. The URL is not considered part of the Receiver's implementation, as it may exist in an entirely different system or domain. The conformance criteria for Webmention receivers is described in Receiving Webmentions Listed below are some known types of Webmention Receivers. * Blogging or microblogging software * Plugins for existing CMS software * Web services and APIs to receive Webmentions and display them as comments via Javascript embed 2.2 Test Suite and Reporting Please submit your implementation reports at http://webmention.net/ implementation-reports/. Instructions are provided at the URL. The implementation report template references the tests available at webmention.rocks. webmention.rocks provides many test cases you can use to live-test your implementation. It also is a useful tool to use while developing a Webmention implementation, as it provides detailed responses when errors are encountered. 3. Webmention Protocol This specification uses the link rel registry as defined by [HTML5] for both HTML and HTTP link relations. 3.1 Sending Webmentions 3.1.1 Create a source document that mentions the target Webmentions are sent "from" a source URL "to" a target URL to notify the target that it has been mentioned at the source URL. Before a Webmention can be sent, there needs to be a source URL to send the Webmention "from", often a blog post but may be any type of content. For example, the URL at https://waterpigs.example/post-by-barnaby may contain the following HTML that has a link to Aaron's post. Example 1
This is a great post 3.1.2 Sender discovers receiver Webmention endpoint The sender MUST fetch the target URL (and follow redirects [FETCH]) and check for an HTTP Link header [RFC5988] with a rel value of webmention. If the content type of the document is HTML, then the sender MUST look for an HTML and element with a rel value of webmention. If more than one of these is present, the first HTTP Link header takes precedence, followed by the first or element in document order. Senders MUST support all three options and fall back in this order. The endpoint MAY be a relative URL, in which case the sender MUST resolve it relative to the target URL according to [URL]. The endpoint MAY contain query string parameters, which MUST be preserved as query string parameters and MUST NOT be sent as POST body parameters when sending the Webmention request. Senders MAY initially make an HTTP HEAD request [RFC7231] to check for the Link header before making a GET request. Example 2 GET /post-by-aaron HTTP/1.1 Host: aaronpk.example HTTP/1.1 200 OK Link: