title: Angular $http service - force not parsing response to JSON
body: <p>I have a "test.ini" file in my server, contain the following text:</p>
  
  <pre><code>"[ALL_OFF]
   [ALL_ON]
  "
  </code></pre>
  
  <p>I'm trying to get this file content via <code>$http</code> service, here is part of my function:</p>
  
  <pre><code>  var params = { url: 'test.ini'};
   $http(params).then(
                   function (APIResponse)
                     {
                       deferred.resolve(APIResponse.data);
                     },
                      function (APIResponse)
                     {
                       deferred.reject(APIResponse);
                     });
  </code></pre>
  
  <p>This operation got an Angular exception (SyntaxError: Unexpected token A).<br>
  I opened the Angular framework file, and I found the exeption:<br>
  Because the text file content start with "<strong>[</strong>" and end with "<strong>]</strong>", Angular "think" that is a JSON file.</p>
  
  <p>Here is the Angular code (line 7474 in <strong>1.2.23 version</strong>):</p>
  
  <pre><code> var defaults = this.defaults = {
      // transform incoming response data
      transformResponse: [function(data) {
        if (isString(data)) {
          // strip json vulnerability protection prefix
          data = data.replace(PROTECTION_PREFIX, '');
          if (JSON_START.test(data) &amp;&amp; JSON_END.test(data))
            data = fromJson(data);
        }
        return data;
      }],
  </code></pre>
  
  <p>My question:</p>
  
  <p>How can I <strong>force</strong> angular to <strong>not</strong> make this check (<code>if (JSON_START.test(data) &amp;&amp; JSON_END.test(data))</code>) and <strong>not</strong> parse the text response to JSON?</p>