title: Ajax request: Refused to set unsafe header
body: <p>I am trying to play an audio using Google Text-To-Speech. Therefore I need to post a request to their endpoint with the <code>Referer</code> and the <code>User-Agent</code> properly set. This call should return an MP3 that I can play.</p>
  <p>However, I get <code>Refused to set unsafe header</code> errors. This is my code. How can I do this?</p>
  <pre><code>          $.ajax({
              url: 'http://translate.google.com/translate_tts?ie=UTF-8&amp;q=Hello&amp;tl=en&amp;client=t',
              beforeSend: function(xhr) {
                   xhr.setRequestHeader(&quot;Referer&quot;, &quot;http://translate.google.com/&quot;);
                   xhr.setRequestHeader(&quot;User-Agent&quot;, &quot;stagefright/1.2 (Linux;Android 5.0)&quot;);
              }, success: function(data){
                  el.mp3 = new Audio(data);
                  el.mp3.play();
              }
            });
  </code></pre>