Michael Chong
Michael Chong

Reputation: 41

Failure to Import Curl in Postman - optionless arguments found

I've tried pasting a raw curl into Postman using File >> Import >> Paste Raw Text. However, I get the error: Error while importing Curl: 2 option-less arguments found. Only one is supported (the URL). Below is the curl.

curl 'https://example.com/api/dataexport/user_token' -X POST -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json' -H 'Accept: application/vnd.boostr.dataexport' -H 'Accept-Encoding: gzip, deflate, sdch, br' -H 'Connection: keep-alive' --data-binary '{"auth":{"email”:”[email protected]”,”password”:”example”}}’ --compressed

Upvotes: 4

Views: 12827

Answers (3)

Tarek Adra
Tarek Adra

Reputation: 510

--compressed not supported remove it from the end

and use the "Copy as CURL (bash)" option

reference

Upvotes: 5

seagulledge
seagulledge

Reputation: 344

When Copying a request from Chrome Dev Tools, use the "Copy as CURL (bash)" option to ensure that Postman will accept the format.

Upvotes: 0

Anant Naugai
Anant Naugai

Reputation: 556

The quotation marks in the value for --data-binary need to be replaced from (typographic quotes) to " (ASCII quotes).

Try importing this:

curl 'https://example.com/api/dataexport/user_token' -X POST -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json' -H 'Accept: application/vnd.boostr.dataexport' -H 'Accept-Encoding: gzip, deflate, sdch, br' -H 'Connection: keep-alive' --data-binary '{"auth":{"email":"[email protected]","password":"example"}}' --compressed

Upvotes: 2

Related Questions