Call curl using cmd?

2019-09-20 10:02发布

问题:

I have the following curl command that I want to convert to .bat file to calling using cmd.

curl -X POST \
  https://api.telerivet.com/v1/projects/PJ331378e28e30b89f/messages/send \
  -H 'Authorization: Basic TFFWcHR6SkxMS0x2a1JwbDBKelBTMExnVHdQbzdybFM6' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 6fde3920-a30d-4daa-9535-ac6373d492f8' \
  -d '{
    "content": "kjdjefk",
    "to_number": "+6586524931"

}'

But get the following error.

回答1:

Here you go:

curl -X POST ^
  https://api.telerivet.com/v1/projects/PJ331378e28e30b89f/messages/send ^
  -H 'Authorization: Basic TFFWcHR6SkxMS0x2a1JwbDBKelBTMExnVHdQbzdybFM6' ^
  -H 'Cache-Control: no-cache' ^
  -H 'Content-Type: application/json' ^
  -H 'Postman-Token: 6fde3920-a30d-4daa-9535-ac6373d492f8' ^
  -d '{^
    "content": "kjdjefk",^
    "to_number": "+6586524931"^
}'


标签: curl cmd