title: Prevent defaultHttpResponseTransform to parse JSON like string
body: <p>AngularJS <code>defaultHttpResponseTransform</code> tries to figure out if data is json and tries to parse it:</p>
  
  <pre><code>function defaultHttpResponseTransform(data, headers) {
    if (isString(data)) {
      // Strip json vulnerability protection prefix and trim whitespace
      var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim();
  
      if (tempData) {
        var contentType = headers('Content-Type');
        if ((contentType &amp;&amp; (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) {
          data = fromJson(tempData);
        }
      }
    }
  
    return data;
  }
  </code></pre>
  
  <p>However data in response in <code>text/plain</code> that is <code>swift</code> message, and looks like <code>JSON</code> but it is not. And when Angular tries to <code>JSON.parse</code> it, I get error:</p>
  
  <blockquote>
    <p>SyntaxError: Unexpected number
        at Object.parse (native)
        at fromJson (<a href="http://localhost:8080/WebEastGui/build/js/app-vendor.js:41198:14" rel="noreferrer">http://localhost:8080/WebEastGui/build/js/app-vendor.js:41198:14</a>)</p>
  </blockquote>
  
  <p>Is there a way to force Angular not to force parsing JSON like string?</p>