My IDE generates curl can export HTTP requests as curl commands. They look like this:
curl --request POST \
--url http://test.api.local/api/tickets/route \
--header 'accept-encoding: gzip' \
--header 'content-type: application/json' \
--data '{
"start_datetime": "2020-11-10T09:30Z",
"brand_id": 33,
"model_id": 90,
"class": 1,
"country_code": "US",
"contract_id": 120071,
}'
but when when I run them in Win10 command prompt or powershell there are a lot of errors:
PS C:\Users\Kosh> curl --request POST \
>> --url http://test.api.local/api/tickets/route \
>> --header 'accept-encoding: gzip' \
>> --header 'content-type: application/json' \
>> --data '{
>> "start_datetime": "2020-11-10T09:30Z",
>> "brand_id": 33,
>> "model_id": 90,
>> "class": 1,
>> "country_code": "US",
>> "contract_id": 120071,
>> }'
At line:2 char:5
+ --url http://entry.dev.tskad/api/tickets/route \
+ ~
Missing expression after unary operator '--'.
At line:2 char:5
+ --url http://entry.dev.tskad/api/tickets/route \
+ ~~~
Unexpected token 'url' in expression or statement.
At line:3 char:5
+ --header 'accept-encoding: gzip' \
+ ~
Missing expression after unary operator '--'.
At line:3 char:5
+ --header 'accept-encoding: gzip' \
+ ~~~~~~
Unexpected token 'header' in expression or statement.
At line:4 char:5
+ --header 'content-type: application/json' \
+ ~
Missing expression after unary operator '--'.
At line:4 char:5
+ --header 'content-type: application/json' \
+ ~~~~~~
Unexpected token 'header' in expression or statement.
At line:5 char:5
+ --data '{
+ ~
Missing expression after unary operator '--'.
At line:5 char:5
+ --data '{
+ ~~~~
Unexpected token 'data' in expression or statement.
At line:5 char:9
+ --data '{
+ ~
The Data section is missing its statement block.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingExpressionAfterOperator
Please tell me if there is a problem with line breaks and if yes how can I avoid it?