Skip to content

Commit 6a1ebf0

Browse files
author
Jann Skotdal
authored
Merge pull request #6 from erhopf/master
Removed auth header from languages samples
2 parents e503f75 + 7d26056 commit 6a1ebf0

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

Languages.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,13 @@
1010

1111
import os, requests, uuid, json
1212

13-
# Checks to see if the Translator Text subscription key is available
14-
# as an environment variable. If you are setting your subscription key as a
15-
# string, then comment these lines out.
16-
if 'TRANSLATOR_TEXT_KEY' in os.environ:
17-
subscriptionKey = os.environ['TRANSLATOR_TEXT_KEY']
18-
else:
19-
print('Environment variable for TRANSLATOR_TEXT_KEY is not set.')
20-
exit()
21-
# If you want to set your subscription key as a string, uncomment the next line.
22-
#subscriptionKey = 'put_your_key_here'
23-
2413
# If you encounter any issues with the base_url or path, make sure
2514
# that you are using the latest endpoint: https://docs.microsoft.com/azure/cognitive-services/translator/reference/v3-0-languages
2615
base_url = 'https://api.cognitive.microsofttranslator.com'
2716
path = '/languages?api-version=3.0'
2817
constructed_url = base_url + path
2918

3019
headers = {
31-
'Ocp-Apim-Subscription-Key': subscriptionKey,
3220
'Content-type': 'application/json',
3321
'X-ClientTraceId': str(uuid.uuid4())
3422
}

0 commit comments

Comments
 (0)