0

I'm trying to import this cURL example into Postman via Import > Raw Text:

curl https://invoice-generator.com \
  -H "Accept-Language: fr-FR" \
  -d from="Invoiced, Inc." \
  -d to="Acme Corp." \
  -d logo="https://invoiced.com/img/logo-invoice.png" \
  -d number=1 \
  -d currency=eur \
  -d date="Feb 9, 2015" \
  -d due_date="Feb 16, 2015" \
  -d items[0][name]="Starter plan monthly" \
  -d items[0][quantity]=1 \
  -d items[0][unit_cost]=99 \
> invoice.pdf

(taken from here)

But I'm getting an error:

Error while importing Curl: e.startsWith Is Not A Function

I've seen posts about this error while running cURL in Postman but obviously this is a different situation and I'm not sure how to resolve this one?

Alex S
  • 190
  • 3
  • 15
  • .. where are you getting that error? looks like you're not running it in a unix terminal? – hanshenrik Nov 24 '22 at 10:21
  • @hanshenrik as I mentioned in my post "I'm trying to import this cURL example into Postman via Import > Raw Text" so no I'm not running it in a Unix terminal – Alex S Nov 24 '22 at 10:22

1 Answers1

1

The last line of this cURL command exports the output to a file called invoice.pdf. Postman can't do that, at least, not in this way.

Postman's cURL import is, in my experience, flaky; make sure that all your quotes are double non-curly quotes, and delete all the 's as well as the > invoice.pdf and it might work OK.

netopiax
  • 155
  • 9
  • Thanks! Turns out all I had to do there was remove the `> invoice.pdf` in this instance, I just didn't realise that Postman would try to do the last bit when doing an import. – Alex S Nov 30 '22 at 21:30