Skip to content

GET method doesn't support body payload #2136

Closed
@karol-lotkowski

Description

@karol-lotkowski

swagger-ui version: 2.1.2

For HTTP GET method Swagger UI doesn't send body payload.
I prepared endpoint (products/test) with simple request data (name field).
On 'Try it out' click the request to specified endpoint is done, but body payload is not included in the request.

Swagger UI test endpoint:
image

GET request without body payload:
image

Issue is strictly related with Swagger UI, because CURL command is correct:

curl -X GET --header "Accept: application/json" --header "Content-Type: application/json" --header "Authorization: Bearer ..." -d "{
  \"name\": \"test_name\"
}" "http://localhost:8080/application/products/test"

Execution of CURL command works as expected: body payload is send with HTTP GET method and match to REST API endpoint.

Based on the HTTP protocol specification GET method doesn't disallow body payload.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions