【发布时间】:2019-02-24 08:12:23
【问题描述】:
当我发出 RxJS Ajax 调用请求时,我设置了请求的标头,但是如何获取 RxJS Ajax 响应的 Cookie?
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(
payLoad => {
console.log(payLoad);
console.log(payLoad.headers);
},
error => console.log(error),
() => console.log( 'done' )
);
【问题讨论】:
标签: javascript ajax cookies rxjs