title: jQuery POST: setting Content-Type to be text/plain
body: <p>I can't figure out why this isn't working. On the server, I have this:</p>
  
  <pre><code>@app.route('/message', methods=['POST'])
  def print_post():
      if request.headers['Content-Type'] == 'text/plain':
          logging.warning(request.data)
          return "Text Message: " + request.data
      else:
          logging.warning('didnt work')
          return 'Unsupported Media Type'
  </code></pre>
  
  <p>I'm sending this request through the browser:</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "https://localhost:8090/message",
      data: 'this is a message'
      contentType: 'test/plain'
  })
  </code></pre>
  
  <p>But I keep getting the error <code>Uncaught SyntaxError: Unexpected identifier</code></p>
  
  <p>What am I doing wrong?</p>