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

Generated cURL injects Content-Type from Body tab instead of honoring custom Content-Type from Headers tab #8290

Closed
meotch opened this issue Apr 7, 2020 · 0 comments · Fixed by #8527

Comments

@meotch
Copy link

meotch commented Apr 7, 2020

Describe the bug
Using 'Code' tab to generate cURL injects an extra Content-Type from 'Body' dropdown-menu instead of honoring the already set Content-Type from 'Headers' tab. Because of this, we have to manually remove the additional --header 'Content-Type: text/plain' \ everytime we want to run a request that has our custom json format

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Request
  2. Go to 'Headers' tab and add a new Content-Type (using any type you'd like that isn't selectable from the 'Body' tab dropdowns.
  3. Go to 'Body' tab and select 'raw' 'text' and fill the body with any random json
  4. Go to 'Code' tab and select cURL in the left pane
    i. Notice that Content-Type `--header 'Content-Type: text/plain' has not been added
  5. Exit the 'Code' popup window and click 'Code' tab again
    i. Notice that Content-Type `--header 'Content-Type: text/plain' is now present and causes Content-Type conflict fo requests

Expected behavior
Content-Type set in the 'Headers' tab should be the ultimate source of truth, Postman shouldn't try to add an extra header here when Content-Type is already present.

  • App Type: Native App
  • Postman Version: 7.21.2
  • OS: Windows 10 Pro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants