3 ms·
I wonder if Accept: application/json Would be a reasonable alternative? Wasn't this supposed to be the point of content negotiation?
by fiddlerwoaroof 6y ago
I wonder if
Accept: application/json
Would be a reasonable alternative? Wasn't this supposed to be the point of content negotiation?
- stingraycharles 6y agoMaybe, but not really; seems like this thread is more about intent (“I just want a preview”) while content type is more about representation (“I want the content as json”). I can imagine that there will be websites that are actively using the accept parameter to distinguish between “regular visitors” and have their APIs at the same paths (didn’t Reddit do this at some point?), and thus your approach would break in this case. I guess what this is really about is, I hate to say it, but something in the direction of the semantic web, where web servers (and in this case, CloudFlare et al) actually gain a deeper understanding of the content they serve, and a web browser / crawler being able to query this content directly.
- stickfigure 6y agoAccept: text/preview
- stingraycharles 6y agoIn what content type? Json? Xml? Html?
- fiddlerwoaroof 6y agoIt seems to me that what "previews" really want is an API for the page's content in a structured format: OpenGraph tags and other microformats are one representation, but it's annoying to have to load _all_ the HTML just to grab title and the OG tags.