title: Angular 6: SyntaxError: Unexpected token O in JSON at position 0 at JSON.parse with valid JSON
body: <p>I am not sure whether my function is wrong, which should send data to the server, or the function on the server is wrong.
  I looked up similar questions but the solution I adopted to my problem did not work.</p>
  
  <p>My function looks like this:</p>
  
  <pre><code>postData(number){
     let array = JSON.stringify(this.locArr);
     return this.http.post&lt;any&gt;(this.url, array)
      .subscribe(),
      error =&gt; console.log("Error: ", error)
      }
  </code></pre>
  
  <p>JSON which is send:</p>
  
  <pre><code>[ 
    { 
        "id":222,
        "name":"Lars",
        "sLA":37
     },
    { 
        "id":223,
        "name":"Sim",
        "sLA":12
     }
  ]
  </code></pre>
  
  <p>All parameters like token etc. are received by the server function but the array I wrote above is null, although it is valid json.
  I wonder why this error is occuring.</p>
  
  <p>Any advice is appreciated</p>