Skip to content

Commit

Permalink
[DOCS] Added note about GET requests with bodies to API conventions (#…
Browse files Browse the repository at this point in the history
…74805) (#74807)

* [DOCS] Added note about GET requests with bodies to API conventions

* Added anchor for request body query string
  • Loading branch information
debadair authored Jul 1, 2021
1 parent 998a97f commit 42fb9ec
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/reference/api-conventions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@

The {es} REST APIs are exposed over HTTP.

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

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

[discrete]
[[api-request-body-query-string]]
==== Request body in query string

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

0 comments on commit 42fb9ec

Please sign in to comment.