cURL Generation inaccurate in Azure APIM portal

Andrey Kurudimov 21 Reputation points
2020-10-11T00:14:56.447+00:00

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.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,805 questions
{count} votes

0 additional answers

Sort by: Most helpful