Skip to content

unipart body is wrapped with outer string quotes. #362

@haroon-sheikh

Description

@haroon-sheikh

Describe the bug
When the request body is a json string, then when getting request body, it is wrapped around additional string quotes.

To Reproduce
Steps to reproduce the behavior:

  1. Create the request object
RequestBodyEntity request = Unirest.post("/post")
       .basicAuth("foo", "bar")
       .header("Content-Type", "application/json")
       .queryString("foo", "bar")
       .body("{\"body\": \"sample\"}");

Expected behavior
request.getBody().get().uniPart().getValue().toString() should return "{\"body\": \"sample\"}" but returns ""{\"body\": \"sample\"}"" instead.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Environmental Data:

  • Java Version - 11
  • Version [e.g. 3.8.06]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions