Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Empty -d '' option confuses Postman #6

Closed
HappyEinara opened this issue Mar 19, 2018 · 2 comments
Closed

Empty -d '' option confuses Postman #6

HappyEinara opened this issue Mar 19, 2018 · 2 comments

Comments

@HappyEinara
Copy link

Many of my collaborators use Postman, which can import cURL commands. Using curlify to send a request from my debugger to them to reproduce is very useful.

However, curlify generates empty -d '' options which appear to be unnecessary (e.g. for a plain GET request). Postman fails to import these unedited commands with an (admittedly nonsensical) error: Error while importing Curl: 0 option-less arguments found. Only one is supported (the URL)

Postman should in my opinion tolerate this better, however I doubt the -d '' is semantically necessary for curlify to generate.

Could you consider removing any options that result in an empty string from the output?

@ofw
Copy link
Owner

ofw commented Mar 19, 2018

Thanks, sounds legit. Fixed!

@dkuku
Copy link

dkuku commented Oct 8, 2019

I had to wrap the params for the d option in quotes - otherwise postman fails on it with the same error
my query:
curl -X POST -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate' -H 'Connection: keep-alive' -H 'Content-Length: 474' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Cookie: ColinsCuriousCookie=COOKIE' -H 'User-Agent: python-requests/2.22.0' -d item=%7BDATA%7B%27ColinsCuriousCookie%27%3A+%27 16a71d3a-e99d-11e9-88c6-0a5fb865b0dc%27%7D%7D https://api-v4-development.key2key.net/queue/v1/queues/customerservice0

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

No branches or pull requests

3 participants