title: How do I send JSON but expect plain-text in response with AJAX / JQuery?
body: <p>In the following script, I post data in JSON format to the server, but the response is sent back in plain-text. </p>
  
  <pre><code>    var regCredentials = {
  
          "username": creds.username,
          "password": creds.password,
          "fname": creds.fname,
          "lname": creds.lname
  
      };
  
      request = $.ajax({
  
          url: "internet.com/register",
          type: "POST",
          crossDomain: true,
          data: regCredentials,
          dataType: "json";
  
          request.always(function (data) {
  
                  console.log("Response: " + data);
                  postResponse(data);
  
          };
  
      });
  </code></pre>
  
  <p>Because the function expects JSON back, a <code>"</code> is appended to the returned data. It's probably parsed too, which doesn't throw an error for some reason. </p>
  
  <p><strong>How can I write a JQuery AJAX Post that accepts a response in plaintext format?</strong></p>
  
  <p>Edit:</p>
  
  <p>My confusion I realize, is that I thought <code>data</code> determined the outgoing and incoming expected format rather than just incoming. Well that doesn't make much sense does it? Thanks for the answer!</p>