title: Angular HttpClient "Http failure during parsing"
body: <p>I try to send an POST request from Angular 4 to my Laravel backend.</p>
  
  <p>My LoginService has this method:</p>
  
  <pre><code>login(email: string, password: string) {
      return this.http.post(`http://10.0.1.19/login`, { email, password })
  }
  </code></pre>
  
  <p>I subscribe to this method in my LoginComponent:</p>
  
  <pre><code>.subscribe(
      (response: any) =&gt; {
          console.log(response)
          location.reload()
      }, 
      (error: any) =&gt; {
          console.log(error)
      })
  </code></pre>
  
  <p>And this is my Laravel backend method:</p>
  
  <pre><code>...
  
  if($this-&gt;auth-&gt;attempt(['email' =&gt; $email, 'password' =&gt; $password], true)) {
    return response('Success', 200);
  }
  
  return response('Unauthorized', 401);
  </code></pre>
  
  <p>My Chrome dev tools says that my request was a success with 200 status code. But my Angular code triggers the <code>error</code> block and gives me this message:</p>
  
  <blockquote>
    <p>Http failure during parsing for <a href="http://10.0.1.19/api/login" rel="noreferrer">http://10.0.1.19/api/login</a></p>
  </blockquote>
  
  <p>If I return an empty array from my backend, it works... So Angular is trying to parse my response as JSON? How can i disable this?</p>