1、一个

    const headers = new Headers({
      'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
      'Accept': '*!/'
    });
    const params = 'username=' + data.username + '&password=' + data.password + '&key=' + data.key + '&verifyCode=' + data.verifyCode;
    return this.ht.post(`${this.config.urlauth}/login`, params, {headers: headers}).map(value => value);

2、多个

httpOptions = {
  headers: new HttpHeaders().set('Content-Type', 'application/json')
  .set('Content-Type', 'application/x-www-form-urlencoded')
}

3、HttpHeaders

const headers = new HttpHeaders({
      'Content-Type': 'application/json'
    });
    const url= ``;
    return this.http.post(url,null,{headers: headers}).pipe(
        map(res=>res)
    )

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
相关资源
相似解决方案