1、获取请求头
downLoadFile(downUrl: string): Observable<any> {
return this.http.get<any>(this.downUrl, {observe: 'response'});
}
2、设置请求头
import { HttpClient, HttpHeaders} from '@angular/common/http';
proVertify(data: any}): Observable<any> {
const setHeaders = new HttpHeaders().set('id', data);
return HttpClient.put(this.auditUrl, data, { headers: setHeaders })
}