Skip to content

Commit 0f3ee7c

Browse files
committed
query: editiorial tweaks, source cleanup (closes #3036)
1 parent 79ea761 commit 0f3ee7c

File tree

1 file changed

+62
-65
lines changed

1 file changed

+62
-65
lines changed

draft-ietf-httpbis-safe-method-w-body.xml

+62-65
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585

8686
<middle>
8787

88-
<section anchor="intro" title="Introduction">
88+
<section title="Introduction" anchor="introduction">
8989
<t>
9090
This specification defines the HTTP QUERY request method as a means of
9191
making a safe, idempotent request that contains content.
@@ -105,7 +105,7 @@ Host: example.org
105105
</t>
106106
<ul>
107107
<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>
109109
<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>
110110
<li>encoding queries directly into the request URI effectively casts every possible combination of query inputs as distinct
111111
resources.</li>
@@ -118,7 +118,7 @@ Host: example.org
118118
request URI.
119119
</t>
120120
<t>
121-
A typical use of HTTP POST for requesting a query:
121+
A typical use of HTTP POST for requesting a query is:
122122
</t>
123123
<artwork type="http-message">
124124
POST /feed HTTP/1.1
@@ -223,7 +223,7 @@ q=foo&amp;limit=10&amp;sort=-published
223223
has appropriate query semantics.
224224
</t>
225225
<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
227227
resource identified by the request URI. That is, QUERY requests do not
228228
alter the state of the targeted resource. However, while processing a
229229
QUERY request, a server can be expected to allocate computing and memory
@@ -234,57 +234,57 @@ q=foo&amp;limit=10&amp;sort=-published
234234
A successful response to a QUERY request is expected to provide some
235235
indication as to the final disposition of the operation. For
236236
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,
238238
it is expected to describe the results of the operation.
239239
</t>
240240

241241
<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>
260260
</section>
261261

262262
<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>
278278
</section>
279279

280280
<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>
288288
</section>
289289

290290
<section title="Caching" anchor="caching">
@@ -299,24 +299,24 @@ q=foo&amp;limit=10&amp;sort=-published
299299
efficiency, by:
300300
</t>
301301
<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>
303303
<li>Normalizing based upon knowledge of format conventions, as indicated by any
304304
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>
306306
<li>Normalizing based upon knowledge of the semantics of the content itself, as indicated by
307307
the request's Content-Type field.</li>
308308
</ul>
309309
<t>
310310
Note that any such normalization is performed solely for the purpose of generating a cache key; it
311311
does not change the request itself.
312312
</t>
313-
</section>
313+
</section>
314314

315315
<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>
320320
</section>
321321

322322
</section>
@@ -384,6 +384,8 @@ Accept-Query: "application/jsonpath", application/sql;charset="UTF-8"</artwork>
384384
information in the URI (e.g., in the query section). This is preferred in some
385385
cases, as the URI is more likely to be logged or otherwise processed
386386
by intermediaries than the request content.
387+
</t>
388+
<t>
387389
If a server creates a temporary resource to represent the results of a QUERY
388390
request (e.g., for use in the Location or Content-Location field) and the request
389391
contains sensitive information that cannot be logged, then the URI of this
@@ -579,13 +581,11 @@ Content-Type: application/json
579581
A simple way to discover support for QUERY is provided by the OPTIONS
580582
(<xref target="HTTP" section="9.3.7"/>) method:
581583
</t>
582-
583584
<artwork type="http-message">
584585
OPTIONS /contacts HTTP/1.1
585586
Host: example.org
586587

587588
</artwork>
588-
589589
<t>Response:</t>
590590
<artwork type="http-message">
591591
HTTP/1.1 200 OK
@@ -598,7 +598,7 @@ Allow: GET, QUERY, OPTIONS, HEAD
598598
<t>
599599
There are alternatives to the use of OPTIONS. For instance, a QUERY request
600600
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,
602602
<xref target="HTTP" section="15.5.6"/>), including the Allow response field.
603603
</t>
604604
</section>
@@ -608,14 +608,12 @@ Allow: GET, QUERY, OPTIONS, HEAD
608608
Discovery of supported media types for QUERY is possible via the Accept-Query
609609
(<xref target="field.accept-query"/>) response field:
610610
</t>
611-
612611
<artwork type="http-message">
613612
HEAD /contacts HTTP/1.1
614613
Host: example.org
615614

616615
</artwork>
617-
618-
<t>Response:</t>
616+
<t>Response:</t>
619617
<artwork type="http-message">
620618
HTTP/1.1 200 OK
621619
Content-Type: application/xhtml
@@ -627,7 +625,7 @@ Accept-Query: application/x-www-form-urlencoded, application/sql
627625
</t>
628626
<t>
629627
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 --
631629
to inspect the Allow (<xref target="HTTP" section="15.5.16"/>) response field:
632630
</t>
633631
<artwork type="http-message">
@@ -742,7 +740,7 @@ Date: Sun, 17 Nov 2024, 16:13:17 GMT
742740
If-None-Match: "42-1"
743741
</artwork>
744742
<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"/>).
746744
</t>
747745
<t>
748746
Note that there's no guarantee that the server will implement this resource
@@ -753,7 +751,7 @@ If-None-Match: "42-1"
753751

754752
<section title="Indirect Responses" anchor="example.indirect">
755753
<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,
757755
<xref target="HTTP" section="15.4.4"/>).
758756
</t>
759757
<t>
@@ -873,10 +871,9 @@ year, total, rejected, verified, hdu, reported
873871
9999, 1, 0, 0, 1, 0
874872
</artwork>
875873
<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:
880877
</t>
881878
<artwork type="http-message">
882879
QUERY /errata.json HTTP/1.1

0 commit comments

Comments
 (0)