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

add "profile" HTTP preference #92

Open
dret opened this issue Dec 19, 2017 · 8 comments
Open

add "profile" HTTP preference #92

dret opened this issue Dec 19, 2017 · 8 comments

Comments

@dret
Copy link
Owner

dret commented Dec 19, 2017

as a way to negotiate and signal profiles in HTTP that is independent of a profile parameter supported by the media type, a profile HTTP preference (based on https://tools.ietf.org/html/rfc7240) would allow profiles to be better supported one the HTTP level.
maybe @jasnell has comments on how appropriate that usage of RFC 7240 would be?

@dret
Copy link
Owner Author

dret commented Dec 19, 2017

there is a possible alternative approach, which is using dedicated profile negotiation header fields: https://github.com/ProfileNegotiation/I-D-Accept--Schema (by @larsgsvensson and @RubenVerborgh)

@dret
Copy link
Owner Author

dret commented Mar 17, 2018

still waiting for feedback from @jasnell, but for now assuming that a profile preference would be in line with the intention of the Prefer header field.

@jasnell
Copy link

jasnell commented Mar 17, 2018

Sorry @dret ! Just spotted this again! Yeah, I think that's fine

@dret
Copy link
Owner Author

dret commented Mar 17, 2018 via email

@larsgsvensson
Copy link

If the client states a preference for a profile using the Prefer header, the server can answer with Preference-Appliedif it honours the preference, but what does it answer if it doesn't and anwers using another profile instead?

@dret
Copy link
Owner Author

dret commented Mar 23, 2018

@larsgsvensson: that would be the same as what happens if the server simply does not understand or ignore the Prefer header: the server does whatever it want to do. preferences are non-binding, and clients have to be prepared to see their preferences being ignored.
https://tools.ietf.org/html/rfc7240#section-2 :

The Prefer request header field is used to indicate that particular server behaviors are preferred by the client but are not required for successful completion of the request. Prefer is similar in nature to the Expect header field with the exception that servers are allowed to ignore stated preferences.

@larsgsvensson
Copy link

larsgsvensson commented Mar 23, 2018

@dret

that would be the same as what happens if the server simply does not understand or ignore the Prefer header: the server does whatever it want to do. preferences are non-binding, and clients have to be prepared to see their preferences being ignored.

OK, thanks. But then there is no way the client would know which profile the data conforms to, as opposed to e. g. media types where client can say Accept: application/ld+json and the server can answer Content-Type: text/html . Even if the client cannot handle that, at least it knows it has received somethin it cannot handle an can act accordingly instead of having to try out different profiles and eventually throw an UnknownProfileException.

@dret
Copy link
Owner Author

dret commented Mar 23, 2018 via email

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

No branches or pull requests

3 participants