Angular 5 - 从请求中删除默认HTTP标头

时间:2018-05-13 11:41:41

标签: javascript angular api http-headers angular5

这里的问题是每当我向服务器发出http post请求时。 这就是我在网络标签中看到的内容

Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en,en-GB;q=0.9
Authorization: Bearer olxyiByY_efkTH_3WavjtTnm0GclhYws....
Connection: keep-alive
Content-Type: application/json

我想删除 接受:application / json,text / plain, /
从我提出的要求。当我提出每个请求时,它会自动设置。

这就是我设置标题的方式

public jwt() {

  let headers = new HttpHeaders({ 'Authorization': 'Bearer ' + currentUser.access_token,
  'x-mol-lang': 'en', 'Content-Type': 'application/json'});

  return ({ withCredentials: true, headers: headers, reportProgress: true});
} 

我正在提供服务并调用jwt函数进行后期操作。

  _this.http.post(_this.url, body, _this.jwtService.jwt()).subscribe();

我想要在我的网络标签中显示的输出没有**接受:application / json,text / plain, / **

有什么方法可以实现这个动作吗?

0 个答案:

没有答案
相关问题