I have created a basic angular $http.post request to receive some data. In order to receive the data I need to provide a key in the header.
The server is responding that the key is missing even though I've explicitly sent it.
100% it's not the server because I used an online curl tool which provided the required response.
$http.post(url, {        
    data:{username: username,password: password},
    headers:{'Content-Type': 'application/x-www-form-urlencoded','key': key},
  })
  .then(function(response){
    console.log(response)
  })
It would be appreciated if someone could spot what I'm doing wrong here. Thanks.
 
     
    