Skip to content

POST requests with no body fail, but empty bodies succeed #2002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mikemahoney218-usgs opened this issue Apr 24, 2025 · 0 comments
Open

POST requests with no body fail, but empty bodies succeed #2002

mikemahoney218-usgs opened this issue Apr 24, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@mikemahoney218-usgs
Copy link
Contributor

Description
This request fails:

curl --location --request POST 'https://demo.pygeoapi.io/master/collections/obs/items'

This request succeeds:

curl --location --request POST 'https://demo.pygeoapi.io/master/collections/obs/items' --data-raw '{}'

My understanding is that a POST request shouldn't necessarily need a body (there's some discussion around https://stackoverflow.com/questions/4191593/is-it-considered-bad-practice-to-perform-http-post-without-entity-body ). Is this behavior expected?

Steps to Reproduce

curl --location --request POST 'https://demo.pygeoapi.io/master/collections/obs/items'

Expected behavior
I'd expect these requests to work and return identical result sets.

Environment

  • pygeoapi version: 0.20.dev0
@mikemahoney218-usgs mikemahoney218-usgs added the bug Something isn't working label Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant