5 ms·
Servers can return something like: Link: </foo>; rel="alternate" type="application/json" You could return multiple of these as a response to a HEAD reques
by treve 2y ago
Servers can return something like:
Link: </foo>; rel="alternate" type="application/json"
You could return multiple of these as a response to a HEAD request for example.
You could also use the Accept header in response to a HTTP OPTIONS request, or as part of a 415 error response.
Accept: application/json, text/html
https://httpwg.org/specs/rfc9110.html#field.accept https://httpwg.org/specs/rfc9110.html#field.accept (yes Accept can be used in responses)
.well-known is not a good place for this kind of thing. That discovery mechanism should only be used in situations where only a domainname is known, and a feature or endpoint needs to be discovered for a full domain. In most cases you want a link.
The building blocks for most of this stuff is certainly there. There's a lot of wheels being reinvented all the time.
- westurner 2y ago> https://httpwg.org/specs/rfc9110.html#field.accept https://httpwg.org/specs/rfc9110.html#field.accept (yes Accept can be used in responses) I think that would solve. HTTP servers SHOULD send one or more Accept: {content_type} HTTP headers in the HTTP Response to an HTTP OPTIONS Request in order to indicate which content types can be requested from that path.
- westurner 2y agoIDK where that should be added though? Maybe REST and W3C LDP and similar The OpenAPI docs could suggest same