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

32.3k Views Asked by At

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

6

There are 6 best solutions below

0
On

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

0
On

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

1
On

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)"

0
On

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: */*"
0
On

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

0
On

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