2.1.3 Webmentions

Webmention is an open standard for distributed interactions among independent web sites.

webmentions-general

Suppose Alice posts to her site. The content is presumably HTML, but could be something else (plain/text, say). Bob now wants to mention that content on his site. He makes a post (the source) that contains the URL of Alice’s post (the target). Again, the source is presumably an HTML document, but may be anything that can express an URL.

Bob, or more likely his publishing software, must now discover Alice’s Webmention endpoint. He does this by fetching Alice’s document via HTTP– if it has a Link header with a rel value of “webmention” that’s Alice’s webmention endpoint (this is how sending webmentions of non-HTML documents is supported). If there is no such header, and the document is HTML, Bob must look through the document itself for <link> or <a> elements with rel values of “webmention”– the first one in the document is Alice’s Webmention endpoint.

Bob then posts x-www-form-urlencoded source & target parameters to Alice’s Webmention endpoint (the target parameter being Alice’s post and the source being Bob’s mention thereof). Alice’s Webmention endpoint will typically do some initial validation of the request, and on success return either “201 Created” or “202 Accepted” to indicate that further processing will take place asynchronously (in the former case, the Location header in the response will include an URL at which the request processing status may be checked).

Asynchronously, Alice verifies the Webmention by issuing an HTTP GET on the source and verify that the source document contains an exact match for the URL given in the target parameter of the Webmention.

At this point, Alice may choose to publish content from Bob’s mention along with any other data it obtained (e.g. “Bob liked...”).

You can see an example of this in action (in conjunction with see POSSE) here.