azure-docs
azure-docs copied to clipboard
curl example does not work
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.
- ID: 69823924-7def-6548-4f85-4ab9b8075d46
- Version Independent ID: 9593dc98-656c-a73a-cbe6-ce201e497b11
- Content: Translator V3.0 Reference - Azure Cognitive Services
- Content Source: articles/cognitive-services/Translator/reference/v3-0-reference.md
- Service: cognitive-services
- Sub-service: translator-text
- GitHub Login: @laujan
- Microsoft Alias: lajanuar
@chrbsg Thanks for your feedback! We will investigate and update as appropriate.
@chrbsg
Thanks for reporting this! We have created a PR for this issue and the changes should go live soon.
#sign-off