Angular HttpClient append headers to HttpHeaders [duplicate]
问题 This question already has answers here : Adding a HTTP header to the Angular HttpClient doesn't send the header, why? (8 answers) Closed 2 years ago . I am upgrading from the HttpServer to the HttpClientService and as part of that I have to switch my headers from Headers to HttpHeaders. However For some reason my custom headers are no longer being appended. What do I need to update to have the headers appended? private getHeaders(headers?: HttpHeaders): HttpHeaders { if (!headers) { headers =