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

Java - OkHttp Code snippet is not support sending payload when using GET method #502

Closed
jizhuozhi opened this issue Jun 29, 2021 · 0 comments · Fixed by #513
Closed

Java - OkHttp Code snippet is not support sending payload when using GET method #502

jizhuozhi opened this issue Jun 29, 2021 · 0 comments · Fixed by #513

Comments

@jizhuozhi
Copy link

Describe the bug
When using Elasticsearch, we usually use queryDSL in the form of GET method and JSON request body. But when using Code snippet generated by OkHttp, we found that queryDSL was not included in the request body.

To Reproduce
See Screenshots

Expected code snippet and corresponding request
Just remove the GET method from the list

//  Since Java OkHttp requires to add extralines of code to handle methods with body
+ const METHODS_WITHOUT_BODY = ['HEAD', 'COPY', 'UNLOCK', 'UNLINK', 'PURGE', 'LINK', 'VIEW'];
- const METHODS_WITHOUT_BODY = ['GET', 'HEAD', 'COPY', 'UNLOCK', 'UNLINK', 'PURGE', 'LINK', 'VIEW'];

Screenshots
image

Additional context
Version of postman-code-generators/Postman app: 8.7.0

@jizhuozhi jizhuozhi changed the title Java - OkHttp Code snippet is not support sending payload when using GET method (and others) Java - OkHttp Code snippet is not support sending payload when using GET method Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant