azure-docs icon indicating copy to clipboard operation
azure-docs copied to clipboard

curl example does not work

Open chrbsg opened this issue 3 years ago • 1 comments

In the "Base URLs" example:

    // Pass secret key and region using headers to a custom endpoint
    curl -X POST " my-ch-n.cognitiveservices.azure.com/translator/text/v3.0/translate?to=fr" \
    -H "Ocp-Apim-Subscription-Key: xxx" \
    -H "Ocp-Apim-Subscription-Region: switzerlandnorth" \
    -H "Content-Type: application/json" \
    -d "[{'Text':'Hello'}]" -v
  • curl fails due to a malformed url (" " prefix)
  • there is no https prefix and curl defaults to http
  • The URL doesn't match the section text which says the base URL should be "api.cognitive.microsofttranslator.com" or similar
  • The example text suggests this is an example to force regional use of Switzerland, it might be better in the "Authenticating with a regional resource" section which covers regional resources, rather than the "Base URLs" section?

Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

chrbsg avatar Oct 17 '22 11:10 chrbsg

@chrbsg Thanks for your feedback! We will investigate and update as appropriate.

YashikaTyagii avatar Oct 17 '22 15:10 YashikaTyagii

@chrbsg

Thanks for reporting this! We have created a PR for this issue and the changes should go live soon.

#sign-off