Skip to content

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

@jizhuozhi

Description

@jizhuozhi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions