~sircmpwn/sr.ht-discuss

2 2

SourceHut Pages: content negotiation

Details
Message ID
<66fe86a41482877785ecac93cd7a3f635e64d231.camel@dylanvanassche.be>
DKIM signature
pass
Download raw message
Hi,

I was wondering if content negotiation is planned or supported by
SourceHut Pages? In some cases I want to provide a machine readable
version of a page in RDF for example, but this requires content
negotiation. 

Kind regards,
Dylan
Details
Message ID
<NxjorMi0d8pLy0ATQy3VrNsW098cjs_654KHgE1WfEZ719RHykEAuzW2BKK9J0Nr2aDP2ylq34kd3_htYxzi-Z9wlv2twxMU4TxeFRa3fZg=@emersion.fr>
In-Reply-To
<66fe86a41482877785ecac93cd7a3f635e64d231.camel@dylanvanassche.be> (view parent)
DKIM signature
pass
Download raw message
On Thursday, July 28th, 2022 at 14:58, Dylan Van Assche <me@dylanvanassche.be> wrote:

> I was wondering if content negotiation is planned or supported by
> SourceHut Pages? In some cases I want to provide a machine readable
> version of a page in RDF for example, but this requires content
> negotiation.

Does the path for both formats need to be the same?

Often times people use a <link rel="alternate"> element (or a Link header)
to achieve this…
Details
Message ID
<e054673112ecd278e18c0418dea5e026e14a5db6.camel@dylanvanassche.be>
In-Reply-To
<NxjorMi0d8pLy0ATQy3VrNsW098cjs_654KHgE1WfEZ719RHykEAuzW2BKK9J0Nr2aDP2ylq34kd3_htYxzi-Z9wlv2twxMU4TxeFRa3fZg=@emersion.fr> (view parent)
DKIM signature
pass
Download raw message
Hi,

On Thu, 2022-07-28 at 13:03 +0000, Simon Ser wrote:
> On Thursday, July 28th, 2022 at 14:58, Dylan Van Assche
> <me@dylanvanassche.be> wrote:
> 
> > I was wondering if content negotiation is planned or supported by
> > SourceHut Pages? In some cases I want to provide a machine readable
> > version of a page in RDF for example, but this requires content
> > negotiation.
> 
> Does the path for both formats need to be the same?
> 

Yes, the URL stays the same but one of the HTTP headers is the
following:

Accept: text/turtle 

instead of 

Accept: text/html

Depending on that header, either the page is served in Turtle format
(an RDF format) for machines or plain HTML for humans.

See
https://www.rfc-editor.org/rfc/rfc9110.html#name-request-content-negotiation

> Often times people use a <link rel="alternate"> element (or a Link
> header)
> to achieve this…

Kind regards,
Dylan
Reply to thread Export thread (mbox)