1

We're attempting to run the following multi-line curl command in a Windows CMD window:

curl -H 'Authorization: Token <SERVER_TOKEN>' \
 -H 'Accept-Language: en_US' \
 -H 'Content-Type: application/json' \
 'https://api.uber.com/v1.2/estimates/price?start_latitude=37.7752315&start_longitude=-122.418075&end_latitude=37.7752415&end_longitude=-122.518075'

When doing so, it appears to be treating each line of code separately.

enter image description here Is there a way to pass a multi-line curl command in a Windows CMD window?

5
  • 2
    Backslash is used to escape or quote (some) things in Unix shells, and C, C++, other C-based (including awk) and Java programs, not in CMD. CMD allows quoting some things, including end-of-line, with ^ uparrow; use that. Commented Jan 17, 2019 at 3:04
  • Its called a caret ^. 0x2191 is the up arrow ↑. Commented Jan 17, 2019 at 3:39
  • @dave_thompson_085 Here is all their names Acute Accent (´), Breve (˘), Caron (ˇ), Cedilla (¸), Circumflex (ˆ), Diæresis / Umlaut (¨), Dialytika Tonos (΅), Dot Above (˙), Dot Below (̣), Double Acute Accent (˝), Grave Accent (```), Hook Above (̉̉), Macron (ˉ), Ring Above (˚), Tilde (˜), Tonos (΄), `). Commented Jan 17, 2019 at 3:50
  • This is the list for European languages and Vietnamese as they have your standard 5 vowels but with 6 modifiers = 30 vowels. The French gave them their written language. Commented Jan 17, 2019 at 4:08
  • @catcat: to someone who grew up with Teletype models 33 and 35, 0x5E will always be uparrow, but I'm willing to compromise on hat. It is definitely not caret; caret is under the baseline, not above x-height, and is U+2038 in Unicode but not in usual 'DOS' codepages at all. Commented Jan 17, 2019 at 23:52

1 Answer 1

1

This worked:

curl "https://api.uber.com/v1.2/estimates/price?start_latitude=37.7752315&start_longitude=-122.418075&end_latitude=37.7752415&end_longitude=-122.518075" -H "Authorization: Token YNjXGKdc8AcnPGzGf-qFm2eFKGeG6RpOHLLgXLH-" -H "Accept-Language: en_US" -H "Content-Type: application/json"

Apparently, needed double quotes, not single quotes.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.