Webmention is a simple way to automatically notify any URL when you link to it on your site. From the receivers perpective, it's a way to request notification when other sites link to it.
It’s a modern alternative to Pingback and other forms of Linkback.
Note that the latest, most up-to-date specification is located on the IndieWebCamp wiki.
http://indiewebcamp.com/webmention
To the extent possible under law, the editors and contributors have waived all copyright and related or neighboring rights to this work. In addition, as of 27 September 2013, the editors and contributors have made this specification available under the Open Web Foundation Agreement Version 1.0.
Here's a typical webmention flow:
GET /post-by-alice HTTP/1.1
Host: alice.host
HTTP/1.1 200 OK
Link: <http://alice.host/webmention-endpoint>; rel="webmention"
<html>
<head>
...
<link href="http://alice.host/webmention-endpoint" rel="webmention" />
...
</head>
<body>
....
<a href="http://alice.host/webmention-endpoint" rel="webmention" />
...
</body>
</html>
The webmention endpoint is advertised in the HTTP Link header or a <link>
or <a>
element with rel="webmention"
. If more than one of these is present, the HTTP Link header takes precedence, followed by the <link>
element, and finally the <a>
element. Clients MUST support all three options and fall back in this order.
POST /webmention-endpoint HTTP/1.1
Host: alice.host
Content-Type: application/x-www-url-form-encoded
source=http://bob.host/post-by-bob&
target=http://alice.host/post-by-alice
HTTP/1.1 202 Accepted
http://alice.host/webmentions/222
202 Accepted
is the recommended status code to return indicating that the request SHOULD be queued and processed asynchronously to prevent DoS attacks. The response body SHOULD include a URL that can be used to monitor the status of the request.
If you choose to process the request and perform the verification step synchronously, you can respond with a 200 OK
status on success.
See Error Responses for what to do when the webmention is not successful.
target
is a valid resource belonging to it and that it accepts webmentions.GET
request on source
to confirm that it actually links to target
(note that the receiver will need to check the Content-Type
of the entity returned by source
to make sure it is a textual response).At this point the receiver can choose to publish information about this webmention along with any other data it picks up from source
.
If the webmention was not successful because of something the sender did, you SHOULD return a 400 Bad Request
status code and MAY include a description of the error in the response body.
Possible sender related errors (from the Pingback specification):
If the webmention was not successful because of an error on the receivers server, it SHOULD return a 500 Internal Server Error
status code and MAY include a description of the error in the response body.
If receiver had received a webmention in the past with the same source
and target
then,
source
for the existing webmention.GET
request on source
) or does not find a link to target
on source
, it SHOULD delete the existing webmention.source
with rel="nofollow"
to prevent spam.source
, it should ensure that the data is encoded and/or filtered to prevent XSS and CSRF attacks.See IMPLEMENTATIONS
source
which will result in a DDoS on Alice's site.Feel free to file an issue if you have feedback/questions/suggestions.