Based on the escape character (^
), looks like the code sample is for a batch file instead, albeit it is still missing ^
at the end of each line, like \ for bash. You could raise an issue on the developer portal repo to address this issue.
cURL Generation inaccurate in Azure APIM portal
In the Developer Portal, it auto generates HTTP requests for you and in different languages. However I noticed the cURL, is not very functional.
For example here is a cURL generated by Postman:
curl --location --request POST 'https://example.com' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "my",
"song": "string"
}'
And here is the same cURL generated by the dev portal.
@ECHO OFF
curl -v -X POST "https://example.com"
-H "Content-Type: application/json"
-H "Cache-Control: no-cache"
--data-ascii "{
^"name^": ^"my^",
^"song^": ^"string^"
}"
If you try to go into Postman and press Import > Raw Text and paste that second cURL it will throw a couple errors. This means people aren't able to copy and paste cURL's from the dev portal to test via Postman. Unless I'm doing something terribly wrong I think this is an issue and the syntax for the portal cURL's needs to be fixed.
Also I am mentioning this here, cause I couldn't figure where I am supposed to bring this up.
-
Pramod Valavala 20,591 Reputation points Microsoft Employee
2020-10-12T15:53:03.707+00:00