Skip to content

Commit 42fb9ec

Browse files
authored
[DOCS] Added note about GET requests with bodies to API conventions (#74805) (#74807)
* [DOCS] Added note about GET requests with bodies to API conventions * Added anchor for request body query string
1 parent 998a97f commit 42fb9ec

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/reference/api-conventions.asciidoc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33

44
The {es} REST APIs are exposed over HTTP.
55

6-
The conventions listed in this chapter can be applied throughout the REST
7-
API, unless otherwise specified.
6+
A number of {es} GET APIs--most notably the search API--support a request body.
7+
While the GET action makes sense in the context of retrieving information,
8+
GET requests with a body are not supported by all HTTP libraries.
9+
All {es} GET APIs that require a body can also be submitted as POST requests.
10+
Alternatively, you can pass the request body as the
11+
<<api-request-body-query-string, `source` query string parameter>>
12+
when using GET.
813

914
* <<multi-index>>
1015
* <<date-math-index-names>>
@@ -672,6 +677,7 @@ The response looks like:
672677
// TESTRESPONSE[s/"stack_trace": "java.lang.Number.+\.\.\."/"stack_trace": $body.error.caused_by.stack_trace/]
673678

674679
[discrete]
680+
[[api-request-body-query-string]]
675681
==== Request body in query string
676682

677683
For libraries that don't accept a request body for non-POST requests,

0 commit comments

Comments
 (0)