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

Can't import curls generated from Code->cUrl (New Code Generation Mode) #8292

Closed
softbucket opened this issue Apr 7, 2020 · 1 comment · Fixed by postmanlabs/curl-to-postman#28 or #8464

Comments

@softbucket
Copy link

softbucket commented Apr 7, 2020

The Code->cURL generator and Postman import is useful for us to share post-body requests around without having to save it to a collection. The cURL generation is either not imported correctly (with new Code Generation) or is imported but not separated into key/value pairs under x-www-form-urlencoded.

For our workflow, saving a collection is an issue because it inundates our space with just "example" requests and even more severe is that it can be accidentally and unexpectedly mutated (more sensitive if after sharing).

To Reproduce
Steps to reproduce the behavior:

  1. Use "New Code Generation Mode"
  2. Import this request:
    curl --location --request POST 'https://httpbin.org/post'
    --header 'accept: application/json'
    --header 'Content-Type: application/x-www-form-urlencoded'
    -d 'test=test'
  3. Click on 'Code'
  4. Scroll down to 'cURL' and copy the content
  5. Import the recently copied content
  6. Body is empty (it is likely because postman import doesn't recognize --data-urlencode)

Note: If New Code Generation Mode is on, then the body does get populated but is not interpreted into the individual key/value pairs in body under x-www-form-urlencoded

Expected behavior
Post man should be able to import its exported cURL requests. Or the legacy behaviour should be imported with the original key/value pairs.

Screenshots
image
image
image
image

App information (please complete the following information):

  • Postman Version 7.21.1
  • OS: Catalina 10.15.4

Additional context
Ultimately, we are looking for an easy copy+paste solution for http-request sharing so that we can share without the need of saving and naming collections.

Previously we were able to flawless do this with the legacy code generation method because it would split each variable as a separate -d. Now it just congeals it all together under one -d and we have to manually perform an awkward search and replace to separate it again.

The new code generation probably would work very well if the import mechanic supported --data-urlencode

It is further awkward that the Postman cURL generation can't generate a request that can be perfectly imported by Postman.

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