Skip to content
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

REST API converts PUT and POST with no body into GET request in-flight #538

Closed
jpignata opened this issue May 27, 2020 · 5 comments
Closed
Labels
bug Something isn't working REST API Related to the API (REST) category/plugins

Comments

@jpignata
Copy link
Contributor

OkHttp seems to convert in-flight POST and PUT requests to GET requests if the body provided is null. This is surprising.

In order to address this, RestOptions should be changed to:

  1. Ensure that the constructor cannot be called directly, rather we should prefer RestOptions.Builder
  2. In the constructor, if provided data is null, pass an empty byte[]
@jpignata jpignata added bug Something isn't working GraphQL API Related to the API (GraphQL) category/plugins labels May 27, 2020
@c0rdeiro
Copy link

when will this bug be addressed?

@jpignata
Copy link
Contributor Author

@c0rdeiro Soon. :) For now, you can work around it by providing an empty body. A better fix is forthcoming.

@c0rdeiro
Copy link

Thank you so much, this was driving me insane in the last 2 days

@jpignata
Copy link
Contributor Author

Same here! Sorry for the trouble.

@TrekSoft
Copy link
Contributor

Got a PR for it right here @c0rdeiro : #539

@eeatonaws eeatonaws added REST API Related to the API (REST) category/plugins and removed GraphQL API Related to the API (GraphQL) category/plugins labels Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working REST API Related to the API (REST) category/plugins
Projects
None yet
Development

No branches or pull requests

4 participants