【发布时间】:2020-02-07 10:31:36
【问题描述】:
这是我的角度服务方法。
public checkIn(checkInRequest: CheckInRequest): Observable<BookingRoomDetails> {
let _headers = new HttpHeaders();
_headers = _headers.append('Content-Type', 'application/json');
let options = {
headers: _headers,
withCredentials: true
}
const url = this._constantService.checkIn;
return this._httpClient.post<BookingRoomDetails>(url, checkInRequest, options);
}
当我控制台记录标题时,我得到了这个。
但是当我从 Chrome 的网络选项卡中打开请求标头时,我找不到自定义标头。
有没有办法添加自定义标题?我知道 HttpHeaders 是不可变的……但它不起作用……
【问题讨论】:
标签: angular typescript header httpclient