neha jain
neha jain

Reputation: 481

To run curl command on postman getting error as Error while importing Curl: arg.startsWith is not a function

I have a curl link which is successfully run with terminal but i want to convert it as a POSTMAN request where link is,

curl -v --silent -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -X GET -u <registry-user>:<registry-password> https://sc-docker-registry.eic.fullstream.ai/v2/<image-name>/manifests/<tag> 2>&1 --insecure  | grep Docker-Content-Digest | awk '{print ($3)}'

I have set header and auth but unable to set 2>&1 --insecure | grep Docker-Content-Digest | awk '{print ($3)}'

Where do I set 2>&1 --insecure | grep Docker-Content-Digest | awk '{print ($3)}' command in postman

Upvotes: 48

Views: 33751

Answers (6)

Huy - Logarit
Huy - Logarit

Reputation: 686

remove character \ in the end of all lines for who is using vscode, replace all by regex replace all by regex

Upvotes: 1

Aditya Rewari
Aditya Rewari

Reputation: 2687

I removed all the single quotes to Double quotes and it worked !!!

Not Working CURL

curl --location --request POST 'http://localhost/data/?type=MOBILE&value=77700023656' \
--header 'accept: */*'

WORKING CURL (changed single quotes --> double quotes)

curl --location --request POST "http://localhost/data/?type=MOBILE&value=77700023656" \
--header "accept: */*"

Upvotes: 2

Piffre
Piffre

Reputation: 671

I had the issue when using "Copy all as cURL (bash)" instead of just "Copy as cURL (bash)".

A few concatenated curl commands were copied. And Postman's import didn't like that.

"Copy all as cURL (bash)" vs "Copy as cURL (bash)"

Upvotes: 35

jawn
jawn

Reputation: 1029

I had the same issue but chrome now gives you the option to copy curl as (bash) or (cmd). I had the issue when using copy as cmd but worked when I used copy as bash

Upvotes: 27

Personally for me the problem was a semicolon at the end of the cURL request. Try to remove all the noise you can until you find what sort of character is making postman have that error

curl 'http://catalog.data.gov/api/3/' \
  -H 'authority: 1fzqk3npw4.execute-api.us-east-1.amazonaws.com' \
  -H 'accept: */*' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36' \  
  --compressed ;

Remove the semicolon at the end

Upvotes: 10

divideByZero
divideByZero

Reputation: 1188

I had the same error and I think it's unrelated to the pipeline arguments you sent at the end of the curl. Enclosing url part into double quotes helped with my case. Looks like its a bug in curl-to-postman library

Upvotes: 14

Related Questions