HTTP请求仅在IE和Edge中获得415

时间:2018-09-13 18:11:08

标签: asp.net angular angular-http

你好,我在另一个浏览器中有一个角度为2的http请求,但工作正常,但只有IE和Edge无法正常工作,并且出现415 http代码错误

 headers = new Headers({'Content-Type': 'application/json'});
getJson(params): Promise<any[]> {
  params = JSON.stringify(params);
  let opts = new RequestOptions({
    headers: this.headers,
    withCredentials: true
  });
  return this.http.post(this.host + "save_info",params ,opts)
          .toPromise()
          .then(response => response.json())
          .catch(this.handleError);

}

0 个答案:

没有答案