none
HTTP Error 400. The request has an invalid header name in SpeechOutput RRS feed

  • Question

  • Hey there,

    I am trying to access the speech output REST API, but it responds me with the vague response:

    HTTP Error 400. The request has an invalid header name.

    Complete response is

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"><HTML><HEAD><TITLE>Bad Request</TITLE><META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD><BODY><h2>Bad Request - Invalid Header</h2><hr><p>HTTP Error 400. The request has an invalid header name.</p></BODY></HTML>

    I am able to obtain an access token, that I successfully used in my speech recognition implementation.

    My POST looks as follows:

    POST /synthesize HTTP/1.1
    Host: speech.platform.bing.com
    Accept: */*
    Content-type: application/ssml+xml
    X-Microsoft-OutputFormat: raw-16khz-16bit-mono-pcm
    User Agent: SIMONE
    X-Search-AppId: 07D3234E49CE426DAA29772419F436CA
    X-Search-ClientID: 1ECFAE91408841A480F00935DC390960
    ocp-apim-subscription-key: <my subscription id>
    Authorization: Baerer <my token>

    <speak version='1.0' xml:lang='en-US'><voice xml:lang='en-US' xml:gender='Female' name='Microsoft Server Speech Text to Speech Voice (en-US, ZiraRUS)'>Microsoft Bing Voice Output API</voice></speak>

    I am on Linux using libcurl for the request. I copied the app id and client id from the example on that is provided. I have no clue where to find other values for it.

    Currently, I a m a bit lost since the server response is not helpful.

    Thanks for any help to push me into the right direction,

    Dirk


    Thursday, April 14, 2016 7:27 AM

All replies

  • OK, got it. There was a missing - in teh User-Agent and the Baerer had to be omitted from authentication. Successful request now looks like

    POST /synthesize HTTP/1.1
    Host: speech.platform.bing.com
    Accept: */*
    Content-type: application/ssml+xml
    X-Microsoft-OutputFormat: raw-16khz-16bit-mono-pcm
    User-Agent: SIMONE
    X-Search-AppId: 07D3234E49CE426DAA29772419F436CA
    X-Search-ClientID: 1ECFAE91408841A480F00935DC390960
    ocp-apim-subscription-key: <my subscription id>
    Authorization: <my token>

    Wednesday, April 20, 2016 9:49 AM