none
Microsoft Translator (text) API POST methods can't read parameters right (new Azure/Cognitive API) RRS feed

  • Question

  • Hello,

    First of all let me begin by saying that i've sucessfully aquired a token and i'm able to use the GET methods properly, however...

    Methods requiring POST are having an issue...


    On the following url:

    https://api.microsofttranslator.com/v2/http.svc/GetLanguageNames?locale=en&languageCodes=en

    We get the following result:

    HTTP/1.1 400 Bad Request
    Cache-Control: private, max-age=604800
    Content-Length: 258
    Content-Type: text/html; charset=utf-8
    Expires: Wed, 02 Nov 2016 12:35:07 GMT
    Last-Modified: Wed, 26 Oct 2016 12:35:07 GMT
    ETag: 9BFAE7A910/26/2016 5:35:07 AM
    X-MS-Trans-Info: 0650.V2_Rest.GetLanguageNames.38FD8F10
    Date: Wed, 26 Oct 2016 12:35:07 GMT

    Argument Exception
    Method: GetLanguageNames()
    Parameter: languageCodes
    Message: Value cannot be null.
    Parameter name: languageCodes
    message id=0650.V2_Rest.GetLanguageNames.38FD8F10

    When using this URL:

    https://api.microsofttranslator.com/v2/http.svc/GetLanguageNames?languageCodes=enEN&locale=en

    HTTP/1.1 400 Bad Request
    Cache-Control: private, max-age=604800
    Content-Length: 258
    Content-Type: text/html; charset=utf-8
    Expires: Wed, 02 Nov 2016 12:47:19 GMT
    Last-Modified: Wed, 26 Oct 2016 12:47:19 GMT
    ETag: 7D0B2E7E10/26/2016 5:47:19 AM
    X-MS-Trans-Info: 0756.V2_Rest.GetLanguageNames.38EF7215
    Date: Wed, 26 Oct 2016 12:47:18 GMT

    Argument Exception
    Method: GetLanguageNames()
    Parameter: languageCodes
    Message: Value cannot be null.
    Parameter name: languageCodes
    message id=0756.V2_Rest.GetLanguageNames.38EF7215


    Only if some how tricked by using & on the URL but then it wont read locale..

    https://api.microsofttranslator.com/v2/http.svc/GetLanguageNames?languageCodes=enEN&locale=en

    HTTP/1.1 400 Bad Request
    Cache-Control: private, max-age=604800
    Content-Length: 256
    Content-Type: text/html; charset=utf-8
    Expires: Wed, 02 Nov 2016 12:49:35 GMT
    Last-Modified: Wed, 26 Oct 2016 12:49:35 GMT
    ETag: 3203182E10/26/2016 5:49:35 AM
    X-MS-Trans-Info: 1151.V2_Rest.GetLanguageNames.38D927EC
    Date: Wed, 26 Oct 2016 12:49:34 GMT

    Argument Exception
    Method: GetLanguageNames()
    Parameter: locale
    Message: 'locale' can not be null or empty
    Parameter name: locale
    message id=1151.V2_Rest.GetLanguageNames.38D927EC

    But the most troubling of all is the method TranslateArray which will not even send a response back... i think it's actually not broken or not implmented yet.. and that's the one we use most!!!

    Wednesday, October 26, 2016 12:57 PM

Answers

All replies