none
Ajax API returns double quoted translations, ex ""deux""

    Question

  • One of the threads on this forum suggests I use a ContentType: 'text/HTML' to resolve this, but I receive the error:

    Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.

                        var url =
                            "https://api.microsofttranslator.com/V2/Ajax.svc/Translate" +
                            "?appId=" + encodeURIComponent(accessToken) +
                            "&from=" + encodeURIComponent(fromLang) +
                            "&to=" + encodeURIComponent(toLang) +
                            "&text=" + encodeURIComponent(text2xlat); //call the bing translator ajax service
                        $.ajax({
                            url: url,
                            type: 'post',
                            contentType: 'text/HTML'
                        }).done(function (data, status) {
    

    ...

    What am I missing?

    • Moved by Just KarlModerator Thursday, March 10, 2016 4:07 PM Looking for the correct forum.
    Friday, March 04, 2016 5:34 PM

Answers

All replies

  • Hello,

    The 'Academic Initiatives - Technical Queries' forum is for posts Related to technical / coding / programming related issues as related to Microsoft's Academic Initiatives.

    As it's off-topic here, I am moving the question to the Where is the forum for... forum.

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join('6D73646E5F6B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

    Thursday, March 10, 2016 4:05 PM
    Moderator
  • Hello,

    I'd ask on the Microsoft Translator API Support forum on User Voice.

    As the User Voice forums are on a different platform, we cannot move the question for you.

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join('6D73646E5F6B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

    Thursday, March 10, 2016 4:07 PM
    Moderator