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

Code snippet: cURL settings: there is a problem with unchecking the 'Use long form options' option #9511

Closed
calvinit opened this issue Feb 1, 2021 · 3 comments · Fixed by postmanlabs/postman-code-generators#663

Comments

@calvinit
Copy link

calvinit commented Feb 1, 2021

Describe the Issue

When I uncheck the 'Use long form options' option, I find the result problematic:

s

In fact, the request body option will still use the long form option (--data-raw) instead of the correct short form option (-d):

c

This is not supported on some systems:

p

I hope this can be corrected like the request header (-H), thank you!

Environment Information

  • Platform Type: Native Desktop App
  • Postman Version: Version 8.0.3
  • Operating System: Windows 10

Additional Context

This problem has been around since version 7.x.y, and it still exists today.

@umeshp7
Copy link

umeshp7 commented Feb 4, 2021

Hey @calvinit! Thanks for reaching out.

We are aware of this and this special handling was added for raw bodies only. Using -d assigns special meaning to some characters which was not desirable for raw bodies.
We will be working on handling this better and come up with a fix soon.

Which version of curl are you on? Since --data-raw was added in curl 7.43.0. If you are on a version higher than that you should hopefully not face any issues.
ref: https://curl.se/docs/manpage.html#--data-raw

@umeshp7 umeshp7 assigned umeshp7 and unassigned VShingala Feb 4, 2021
@umeshp7 umeshp7 added the bug label Feb 4, 2021
@calvinit calvinit closed this as completed Feb 4, 2021
@calvinit
Copy link
Author

calvinit commented Feb 4, 2021

@umeshp7 Hi, I checked that I am currently using version 7.29.0. But in fact, there may be more than one version because there is usually not only one application server machine. Wouldn't it be more common for us to use the "-d" short form option? Generally speaking, the higher version of the syntax is compatible with the lower version.

# curl --version
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.44 zlib/1.2.7 libidn/1.28 libssh2/1.8.0
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp 
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets

@calvinit calvinit reopened this Feb 4, 2021
@umeshp7
Copy link

umeshp7 commented Feb 4, 2021

Yes that makes sense, and I understand your concerns. We will be fixing this issue soon and I have labeled it as bug to track it faster. You could try using curl v7.43 or higher as a workaround till we have a fix.
Will update this thread as soon as we have released that fix.

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.

5 participants