In angular 1, I was able to manipulate the http object so the request header for a post included authentication like this:
$http.defaults.headers.common['Authorization'] = "Token " + sessionobject.token;
return $http({
method: 'POST',
url: SERVER_ENVIRONMENT + 'updatepath',
headers: {
'Content-Type': 'application/json',
'Data-Type': 'json'
},
data: {
id : id,
...
}
})
Can you please help me find the equvilant in Angular 2 that generates the same post request? many thnx in advance