-
Notifications
You must be signed in to change notification settings - Fork 146
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
Interaction between Accept-Query and Allow #2860
Comments
@hawkinsw (hi Will!) asks a good question here. That made me ask something else:
Of course, the real question is what Will asks: if the resource responds with 405 and lists a number of methods, how do you interpret the Accept/Accept-Query/Accept-Encoding fields of that response? It is entirely reasonable for a resource to support different media types for different methods. One approach would be to say that managing the matrix of combinations is too difficult. These fields therefore only apply to the specific request that was made. That leads to Accept-* having no real meaning for a 405 response. Under that interpretation, I can't see any reason to define Accept-Query over a straight Accept. This is the most that RFC 9110 says, which isn't much. |
Hello back!!
I was wondering this very thing, too. Read what comes next with the caveat that I am not an expert at HTTP semantics but have started added It seemed to me that the
It does seem that there is a pretty interesting matrix of possibilities there. I think that the approach you outline is workable but ultimately it seems to depend on, as you said, whether or not there is an actual reason to define Accept-Query. PS: A sincere thank you for validating that my question wasn't entirely stupid. |
You're correct that Accept-Query adds only one bit of information over Accept -- the fact that the QUERY method is supported on this resource. I'm inclined to say that requiring at least one content type is reasonable, since this is an object the server will need to interpret, not just store. (The same argument could be made for PATCH.) If the server must be able to read it, the server has a list of formats it can interpret, and that can't be wide-open. Arguably, one could use Accept and then use Allow to advertise QUERY support. |
Or we could just re-use the syntax for Accept (https://greenbytes.de/tech/webdav/rfc9110.html#field.accept) which would allow "*/*". And clients could just re-use their field value parser for "Accept". @mnot - want to suggest SF syntax? |
It's either a SF or not - you can't both define it as a SF and also re-use existing parsers. If we go SF, it would either be a List of Strings or a List of Tokens (using Strings when the field name contains disallowed character). |
In both case we would use existing parsers, no? |
Yes, as long as it's the right one. |
Suppose you have a resource which allows |
there are already the use case i'm envisioning is advertising support for, say, specialized profiles of a media type, like for example
|
I would prefer SF with List of Tokens (with a string fallback for things like the one below). It's entirely possible to reuse Accept parsing, but there are things that we don't need from that, like q-values, such that it would be cleaner to just list the acceptable media types. SF is purpose-built for that. That means:
Parameters outside of the string would have no semantic. Media type parameters go inside the string because they are part of the media type. It's nice how Token includes "/", enabling this use case. |
OK, we have two discussions here:
I propose to open a separate ticket for 2); and then we can concentrate on 1) first. |
Given the activity on the draft, I had assumed that the first was already decided in favour :) Happy to be corrected. The use case seems fairly solid. It doesn't sound super important, but the definition of a field seems cheap enough that the outcome is worth the price. |
Summarizing: we seem to be in agreement that Accept-Query is useful. Open questions:
|
I think this issue can be closed now. |
Hello. I hope that these comments/questions are helpful. If not, please feel free to ignore them.
The QUERY extension says that a server may respond with an Accept-Query header whose value is a list of one or more content types it supports for encoding queries.
Again, I hope that these questions are helpful. If they are, and there is a consensus on how to proceed, I would be more than happy to help draft some changed language. If these are not helpful, please just tell me to go away.
Thanks for your work on this interesting extension!
The text was updated successfully, but these errors were encountered: