Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request Content Negotiation Style #38

Open
YoucTagh opened this issue Jun 26, 2023 · 6 comments
Open

Request Content Negotiation Style #38

YoucTagh opened this issue Jun 26, 2023 · 6 comments

Comments

@YoucTagh
Copy link

What do you think of the idea to add a new subsection reflecting the new CN style Request Content Negotiation introduced in RFC 9110? This is similar to HTTP Client hints and Vary/Allow used in the document.

Description of the CN style:

By sending an accept-profile header in a response, the server can influence the selection of an appropriate content for subsequent requests for a resource (i.e., to indicate a preferred profile for subsequent requests for that resource). An example of client/server interaction:

Client request example:

GET /document HTTP/1.1
Host: example.org
Accept: text/turtle, application/rdf+xml
Connection: close

Server response example:

HTTP/1.1 200 OK
Content-Type: text/turtle
Vary: Accept, Accept-Profile
Accept-Profile: "http://example.org/shapes/shape-1"
Content-Length: 8724
Connection: close
...
@RubenVerborgh
Copy link
Member

That would be a different way of advertising then, which the Link headers already do?

@YoucTagh
Copy link
Author

Quoting from the current draft:

The "Link" header indicates the profile of the returned representation but also points at two alternative representations, each of which conforms to another profile.

As I understand it, it does not have the semantics to convey a preference from a server to a client. On the other hand, the Accept-Profile, when sent in a response, indicates the server's preferred profiles in the subsequent requests.

@larsgsvensson
Copy link
Member

As I understand it, it does not have the semantics to convey a preference from a server to a client. On the other hand, the Accept-Profile, when sent in a response, indicates the server's preferred profiles in the subsequent requests.

Would that preference be to indicate "these are the only profiles that work for this resource"? If not, why would a server want to indicate which profiles a client should ask for?

@hvdsomp
Copy link
Collaborator

hvdsomp commented Jul 26, 2023

That is my interpretation. Seems more realistic to me that a server lets a client know what it supports than a client asking a server for whichever profile. I wonder what the interpretation of @YoucTagh is.

@YoucTagh
Copy link
Author

YoucTagh commented Aug 2, 2023

This is also my interpretation. I can add that if the server uses the same accept profile syntax, q-values could be used to indicate a preference for some profiles over others, a use case being that checking the conformance of a profile requires less computational power for the server.

@hvdsomp
Copy link
Collaborator

hvdsomp commented Dec 12, 2024

It just, very belatedly, occurred to me that this approach could be a way to get rid of the dependency on the formats attribute from Link Hints. Although my understanding is that Request Content Negotiation would be about a server indicating its preferred profiles, it seems to me it could also be used to advertise all available profiles, in the same way the current spec does with alternate links.

A drawback I see is that the content of Accept-Profile could become significantly large. With the Link header approach, there is a way to move links into a Linkset in case the header becomes too large. There's no such way out for Accept-Profile.

It also would be a very significant change ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants