-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
I am developing an web App that calls the Text Translation API. My whole project is developed in Python2.7 so I try to call the APIs in Python2.7. But I always get the failure result:
send: 'POST /translate?api-version=3.0&to=zh HTTP/1.1\r\nHost: api.cognitive.microsofttranslator.com\r\nAccept-Encoding: identity\r\nContent-Length: 19\r\nOcp-Apim-Subscription-Key: [my-sub-key]\r\nContent-type: application/json\r\nX-ClientTraceId: 7ade7c69-7100-4afb-8bb7-676d594637c4\r\n\r\n'
send: '[{"Text": "Hello"}]'
DEBUG:root:
reply: 'HTTP/1.1 404 Not Found\r\n'
My code is in https://github.com/yangpancn/alchemy/blob/master/ms_translator.py
could someone provide a demo code how to use the API in python2.7?
Thanks in advance!
Metadata
Metadata
Assignees
Labels
No labels