Skip to content

HTTP Code Generation does not handle x-www-form-urlencoded content correctly #454

@sausa28

Description

@sausa28

Describe the bug
The raw request HTTP snippet does not correctly encode the request body when using the x-www-form-urlencoded content-type in the request builder. It appears to encode some characters, but not all. Note that the actual request has the correct content, but it is just the HTTP in the code snippet window.

To Reproduce
Steps to reproduce the behavior:

  1. Create a request with a body type set to x-www-form-urlencoded.
  2. Add a key-value pair with key data and value example!£$%^&
  3. Inspect the raw HTTP code generated. The body should be data=example!%C2%A3%24%25%5E%26, but is instead set to data=example!£$%^%26, it has only encoded the ampersand.

Expected code snippet and corresponding request
Expected HTTP code snippet:

POST / HTTP/1.1
Host: www.example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 33

data=example!%C2%A3%24%25%5E%26

Screenshots
Example request:
image

Incorrect HTTP code:
image

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