When using RxJS to make an Ajax call request, I am able to set the headers of the request. However, I am wondering how I can retrieve the Cookie from the RxJS Ajax Response?
import { ajax } from 'rxjs/ajax';
ajax({
url: "some url",
body: {
parameter1: "abc",
parameter2: "def"
},
headers: {
"Content-Type": "application/json",
"Cache-Control": "no-cache"
},
method: 'POST',
responseType: 'json'
})
.subscribe(
response => {
console.log(response);
console.log(response.headers);
},
error => console.log(error),
() => console.log( 'done' )
);