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

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

Closed
DM-Francis opened this issue Feb 11, 2021 · 1 comment · Fixed by #455
Closed

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

DM-Francis opened this issue Feb 11, 2021 · 1 comment · Fixed by #455

Comments

@DM-Francis
Copy link
Contributor

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

@webholik
Copy link
Collaborator

@DM-Francis That's for your work! It may take a couple weeks for the fix to make it to the Postman app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants