85
85
86
86
<middle >
87
87
88
- <section anchor = " intro " title = " Introduction " >
88
+ <section title = " Introduction " anchor = " introduction " >
89
89
<t >
90
90
This specification defines the HTTP QUERY request method as a means of
91
91
making a safe, idempotent request that contains content.
@@ -105,7 +105,7 @@ Host: example.org
105
105
</t >
106
106
<ul >
107
107
<li >often size limits are not known ahead of time because a request can pass through many uncoordinated
108
- system (but note that <xref section =" 4.1" target =" HTTP" /> recommends senders and recipients to support at least 8000 octets),</li >
108
+ systems (but note that <xref section =" 4.1" target =" HTTP" /> recommends senders and recipients to support at least 8000 octets),</li >
109
109
<li >expressing certain kinds of data in the target URI is inefficient because of the overhead of encoding that data into a valid URI, and</li >
110
110
<li >encoding queries directly into the request URI effectively casts every possible combination of query inputs as distinct
111
111
resources.</li >
@@ -118,7 +118,7 @@ Host: example.org
118
118
request URI.
119
119
</t >
120
120
<t >
121
- A typical use of HTTP POST for requesting a query:
121
+ A typical use of HTTP POST for requesting a query is :
122
122
</t >
123
123
<artwork type =" http-message" >
124
124
POST /feed HTTP/1.1
@@ -223,7 +223,7 @@ q=foo&limit=10&sort=-published
223
223
has appropriate query semantics.
224
224
</t >
225
225
<t >
226
- QUERY requests are both safe and idempotent with regards to the
226
+ QUERY requests are both safe and idempotent with regard to the
227
227
resource identified by the request URI. That is, QUERY requests do not
228
228
alter the state of the targeted resource. However, while processing a
229
229
QUERY request, a server can be expected to allocate computing and memory
@@ -234,57 +234,57 @@ q=foo&limit=10&sort=-published
234
234
A successful response to a QUERY request is expected to provide some
235
235
indication as to the final disposition of the operation. For
236
236
instance, a successful query that yields no results can be represented
237
- by a 204 No Content response. If the response includes content,
237
+ by a 204 ( No Content) response. If the response includes content,
238
238
it is expected to describe the results of the operation.
239
239
</t >
240
240
241
241
<section title =" Content-Location and Location Fields" anchor =" location" >
242
- <t >
243
- Furthermore, a successful response can include a Content-Location
244
- header field (see <xref target =" HTTP" section =" 8.7" />) containing an
245
- identifier for a resource corresponding to the results of the
246
- operation. This represents a claim from the server that a client can send
247
- a GET request for the indicated URI to retrieve the results of the query
248
- operation just performed. The indicated resource might be temporary.
249
- </t >
250
- <t >
251
- A server &MAY; create or locate a resource that identifies the query
252
- operation for future use. If the server does so, the URI of the resource
253
- can be included in the Location header field of the response (see <xref
254
- target =" HTTP" section =" 10.2.2" />). This represents a claim that a client can
255
- send a GET request to the indicated URI to repeat the query operation just
256
- performed without resending the query payload. This resource might be
257
- temporary; if a future request fails, the client can retry using the
258
- original QUERY resource and the previously submitted payload again .
259
- </t >
242
+ <t >
243
+ Furthermore, a successful response can include a Content-Location
244
+ header field (see <xref target =" HTTP" section =" 8.7" />) containing an
245
+ identifier for a resource corresponding to the results of the
246
+ operation. This represents a claim from the server that a client can send
247
+ a GET request for the indicated URI to retrieve the results of the query
248
+ operation just performed. The indicated resource might be temporary.
249
+ </t >
250
+ <t >
251
+ A server can create or locate a resource that identifies the query
252
+ operation for future use. If the server does so, the URI of the resource
253
+ can be included in the Location header field of the response (see <xref
254
+ target =" HTTP" section =" 10.2.2" />). This represents a claim that a client can
255
+ send a GET request to the indicated URI to repeat the query operation just
256
+ performed without resending the query payload. This resource might be
257
+ temporary; if a future request fails, the client can retry using the
258
+ original QUERY resource and the previously submitted payload.
259
+ </t >
260
260
</section >
261
261
262
262
<section title =" Redirection" anchor =" redirection" >
263
- <t >
264
- In some cases, the server may choose to respond indirectly to the QUERY
265
- request by redirecting the user agent to a different URI (see
266
- <xref target =" HTTP" section =" 15.4" />). The semantics of the redirect
267
- response do not differ from other methods. For instance, a 303 (See Other)
268
- response would indicate that the Location field identifies an
269
- alternate URI from which the results can be retrieved
270
- using a GET request (this use case is also covered by the
271
- use of the Location response field in a 2xx response).
272
- On the other hand, response codes 307 (Temporary Redirect) and 308
273
- (Permanent Redirect) can be used to request the user agent to redo
274
- the QUERY request on the URI specified by the Location field.
275
- Various non-normative examples of successful
276
- QUERY responses are illustrated in <xref target =" examples" />.
277
- </t >
263
+ <t >
264
+ In some cases, the server may choose to respond indirectly to the QUERY
265
+ request by redirecting the user agent to a different URI (see
266
+ <xref target =" HTTP" section =" 15.4" />). The semantics of the redirect
267
+ response do not differ from other methods. For instance, a 303 (See Other)
268
+ response would indicate that the Location field identifies an
269
+ alternate URI from which the results can be retrieved
270
+ using a GET request (this use case is also covered by the
271
+ use of the Location response field in a 2xx response).
272
+ On the other hand, response codes 307 (Temporary Redirect) and 308
273
+ (Permanent Redirect) can be used to request the user agent to redo
274
+ the QUERY request on the URI specified by the Location field.
275
+ Various non-normative examples of successful
276
+ QUERY responses are illustrated in <xref target =" examples" />.
277
+ </t >
278
278
</section >
279
279
280
280
<section title =" Conditional Requests" anchor =" conditional" >
281
- <t >
282
- A conditional QUERY requests that the selected representation
283
- (i.e., the query results, after any content negotiation) be
284
- returned in the response only under the circumstances described by the
285
- conditional header field(s), as defined in
286
- <xref target =" HTTP" section =" 13" />.
287
- </t >
281
+ <t >
282
+ A conditional QUERY requests that the selected representation
283
+ (i.e., the query results, after any content negotiation) be
284
+ returned in the response only under the circumstances described by the
285
+ conditional header field(s), as defined in
286
+ <xref target =" HTTP" section =" 13" />.
287
+ </t >
288
288
</section >
289
289
290
290
<section title =" Caching" anchor =" caching" >
@@ -299,24 +299,24 @@ q=foo&limit=10&sort=-published
299
299
efficiency, by:
300
300
</t >
301
301
<ul >
302
- <li >Removing content encoding(s) (<xref target =" HTTP" section =" 8.4" />)</li >
302
+ <li >Removing content encoding(s) (<xref target =" HTTP" section =" 8.4" />). </li >
303
303
<li >Normalizing based upon knowledge of format conventions, as indicated by any
304
304
media subtype suffix in the request's Content-Type field (e.g., "+json", see
305
- <xref target =" RFC6838" section =" 4.2.8" />)</li >
305
+ <xref target =" RFC6838" section =" 4.2.8" />). </li >
306
306
<li >Normalizing based upon knowledge of the semantics of the content itself, as indicated by
307
307
the request's Content-Type field.</li >
308
308
</ul >
309
309
<t >
310
310
Note that any such normalization is performed solely for the purpose of generating a cache key; it
311
311
does not change the request itself.
312
312
</t >
313
- </section >
313
+ </section >
314
314
315
315
<section title =" Range Requests" anchor =" range" >
316
- <t >
317
- The semantics of Range Requests for QUERY are identical to those for GET,
318
- as defined in <xref target =" HTTP" section =" 14" />.
319
- </t >
316
+ <t >
317
+ The semantics of Range Requests for QUERY are identical to those for GET,
318
+ as defined in <xref target =" HTTP" section =" 14" />.
319
+ </t >
320
320
</section >
321
321
322
322
</section >
@@ -384,6 +384,8 @@ Accept-Query: "application/jsonpath", application/sql;charset="UTF-8"</artwork>
384
384
information in the URI (e.g., in the query section). This is preferred in some
385
385
cases, as the URI is more likely to be logged or otherwise processed
386
386
by intermediaries than the request content.
387
+ </t >
388
+ <t >
387
389
If a server creates a temporary resource to represent the results of a QUERY
388
390
request (e.g., for use in the Location or Content-Location field) and the request
389
391
contains sensitive information that cannot be logged, then the URI of this
@@ -579,13 +581,11 @@ Content-Type: application/json
579
581
A simple way to discover support for QUERY is provided by the OPTIONS
580
582
(<xref target =" HTTP" section =" 9.3.7" />) method:
581
583
</t >
582
-
583
584
<artwork type =" http-message" >
584
585
OPTIONS /contacts HTTP/1.1
585
586
Host: example.org
586
587
587
588
</artwork >
588
-
589
589
<t >Response:</t >
590
590
<artwork type =" http-message" >
591
591
HTTP/1.1 200 OK
@@ -598,7 +598,7 @@ Allow: GET, QUERY, OPTIONS, HEAD
598
598
<t >
599
599
There are alternatives to the use of OPTIONS. For instance, a QUERY request
600
600
can be tried without prior knowledge of server support. The server would then
601
- either process the request, or could respond with a 4xx status such as 405 (" Method Not Allowed" ,
601
+ either process the request, or could respond with a 4xx status such as 405 (Method Not Allowed,
602
602
<xref target =" HTTP" section =" 15.5.6" />), including the Allow response field.
603
603
</t >
604
604
</section >
@@ -608,14 +608,12 @@ Allow: GET, QUERY, OPTIONS, HEAD
608
608
Discovery of supported media types for QUERY is possible via the Accept-Query
609
609
(<xref target =" field.accept-query" />) response field:
610
610
</t >
611
-
612
611
<artwork type =" http-message" >
613
612
HEAD /contacts HTTP/1.1
614
613
Host: example.org
615
614
616
615
</artwork >
617
-
618
- <t >Response:</t >
616
+ <t >Response:</t >
619
617
<artwork type =" http-message" >
620
618
HTTP/1.1 200 OK
621
619
Content-Type: application/xhtml
@@ -627,7 +625,7 @@ Accept-Query: application/x-www-form-urlencoded, application/sql
627
625
</t >
628
626
<t >
629
627
An alternative to checking Accept-Query would be to make a QUERY request, and then
630
- - in case of a 4xx status such as 415 (" Unsupported Media Type" , <xref target =" HTTP" section =" 12.5.1" />) response -
628
+ -- in case of a 4xx status such as 415 (Unsupported Media Type, <xref target =" HTTP" section =" 12.5.1" />) response - -
631
629
to inspect the Allow (<xref target =" HTTP" section =" 15.5.16" />) response field:
632
630
</t >
633
631
<artwork type =" http-message" >
@@ -742,7 +740,7 @@ Date: Sun, 17 Nov 2024, 16:13:17 GMT
742
740
If-None-Match: "42-1"
743
741
</artwork >
744
742
<t >
745
- would result in a 304 response (" Not Modified" , <xref target =" HTTP" section =" 15.4.5" />).
743
+ would result in a 304 response (Not Modified, <xref target =" HTTP" section =" 15.4.5" />).
746
744
</t >
747
745
<t >
748
746
Note that there's no guarantee that the server will implement this resource
@@ -753,7 +751,7 @@ If-None-Match: "42-1"
753
751
754
752
<section title =" Indirect Responses" anchor =" example.indirect" >
755
753
<t >
756
- Servers can send "indirect" responses using the status code 303 (" See Other" ,
754
+ Servers can send "indirect" responses using the status code 303 (See Other,
757
755
<xref target =" HTTP" section =" 15.4.4" />).
758
756
</t >
759
757
<t >
@@ -873,10 +871,9 @@ year, total, rejected, verified, hdu, reported
873
871
9999, 1, 0, 0, 1, 0
874
872
</artwork >
875
873
<t >
876
- Note the Accept-Query response field indicating that another query format - JSONPath
877
- (<xref target =" RFC9535" />) - is supported as well. The request below would report the
878
- identifiers of all rejected errata submitted
879
- since 2024:
874
+ Note the Accept-Query response field indicating that another query format -- JSONPath
875
+ (<xref target =" RFC9535" />) -- is supported as well. The request below would report the
876
+ identifiers of all rejected errata submitted since 2024:
880
877
</t >
881
878
<artwork type =" http-message" >
882
879
QUERY /errata.json HTTP/1.1
0 commit comments