-1
HttpHeaders에서 헤더를 처리하여 HttpClient를 통해 http 요청에 헤더를 사용하는 방법을 파악하려고합니다.각도 5의 HttpHeaders에 헤더를 설정하는 방법
const headers = new HttpHeaders();
headers.append('foo', 'bar');
headers.set('foo', 'bar');
console.log(headers.get('foo')) // null
그것은 단지 이런 식으로 작동합니다
const headers = new HttpHeaders().set('foo', 'bar');
console.log(headers.get('foo')) // bar
헤더를 추가하는 특별한 방법이 있나요? 아니면 버그입니까?
[이것을 확인하십시오] (https://github.com/angular/angular/issues/19044) –