-
Notifications
You must be signed in to change notification settings - Fork 149
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
query method: examples #1906
Comments
One obvious use case is to convert use of POST to QUERY. This implies that we should document/use "application/x-www-form-urlencoded", right? |
So how do we do it? Do we just say that the payload format is the same as for POST, and the response format is undefined (but maybe selected by Accept)? |
Ultimately, I think these have to be defined by the resource. The client can inform the server what it's sending and express preferences for the response, but there's too much context that the protocol can't specify. So yes, I think it's the same as POST but with safety/idempotency claims around the behavior. |
Proposal: use https://www.rfc-editor.org/rfc/rfc9535 for examples (we would just have to figure out the response format) |
Proposed structure:
Potentially combined into fewer examples. cc: @MikeBishop |
...and move them into appendix. |
The section should note that these examples are illustrative only; if one needs to send queries that are actually this short, it is probably better to use GET. |
Simple Query
|
Discovery of QUERY support
|
Discovery of QUERY formats
|
Content-Location and Location
Content-Location(Content-Location identifies a resource holding the result for the QUERY response it appeared on)
Location(Location identifies a resource that will respond to GET with a fresh result, just like the original QUERY would have)
(one entry removed at 2024-11-17T16:12:01Z)
|
I'm done with most of these (see branch). The only thing I still want to add is examples that are a bit more interesting. Anf of course then I'll hear ETOOMANYEXAMPLES. But it's otherwise a short spec, so why not. Please review: @mnot @martinthomson @MikeBishop (James and Ashok do not seem to be here). Finish the sectio, declare victory, and get out a new I-D in time before the nextt meeting? |
I would flip the last two in your content- location/location example. Then you can show that the content-location content is stable. That would require a change to the dates. Otherwise, this seems like the right amount, not too many. |
+1 The one thing I want to add is something with more interestin query formats, combined with the topic of conneg. |
@martinthomson - your proposal is to have C-L and 303 in adjacent sections, right? |
A query format people would be interested in is GraphQL. |
@desiderantes - can you provide examples? |
They happen to have a draft for specifying GraphQL over HTTP, but I can cook some examples if needed |
None of your current examples use 303, so I'm not following. My point was only that you should have QUERY >> GET to Location >> GET to Content-Location, to clearly demonstrate that the last request was unaffected by changes to the underlying resource. I'd show all of those under the same section heading. |
Ah. I added 303; there was a race condition with your comment. FWIW; 303 was added as a sibling section to those. Maybe it makes more sense now? |
Ah, the 303 example is in the draft, but not this issue. All good. As far as something like GraphQL goes, I think that what you have is enough. There is no need to show alternatives, unless you want to show content type negotiation for requests as an advanced case. |
I'm going to add XSLT/JsonPath as query format examples - I believe we are done then. |
It would be good to have examples that use a well-defined query language incl media type, and a well-defined response media type.
The text was updated successfully, but these errors were encountered: