简体   繁体   中英

Using curl command in Windows prompt how to execute multi line command?

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.

在此处输入图片说明 Is there a way to pass a multi-line curl command in a Windows CMD window?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM