News for hackers. Stuff that matters.

Ask HN: What would you think of a new HTTP method named PREVIEW?

With the success of Open Graph, lots and lots of HTTP GET requests are sent every day to process only a few <meta> in the <head> of HTML pages.

I believe that this process could be lightened by the adoption of a new HTTP verb. By sending an HTTP PREVIEW /mypage we could leverage caching and write optimized database queries to return a light, serialized response for crawlers and bots.

( 3 comments | 2 points | on HN )
Re:Ask HN: What would you think of a new HTTP method named P... by detaro on Saturday April 25, 2020 @04:55AM (#22976729)
Why wouldn't this just be a new Content-Type to request?
Re:Ask HN: What would you think of a new HTTP method named P... by slowmotarget on Saturday April 25, 2020 @05:03AM (#22976759)
If this behavior is to be implemented through request headers, I'd prefer not to mess with Content-Type because it may be needed in the request: you could still want to PREVIEW but ask for a preferred content-type, like text/xml or application/json
Re:Ask HN: What would you think of a new HTTP method named P... by detaro on Saturday April 25, 2020 @06:52AM (#22977218)
It IMHO doesn't make sense to ask for "give me a preview as any JSON" - rather, you'd want a specific JSON based format for preview information (be it oEmbed-json, some json-serialization of og:-style data, jf2, ...), and thus want to ask for a content type specific to that.

Also, from a practical perspective: that approach is easy to implement by using existing tech. Attempting to introduce a new HTTP method is almost guaranteed to fail, both on a technical (getting support into all the things that process HTTP along the way) and the political (actually getting it in a standard) level.