У меня проблема с моим угловым приложением, так как я не могу получить данные в HttpResponseHeader.
это мой ответ:
![enter image description here](https://i.stack.imgur.com/xQYCh.png)
мой сервисный код:
getUsers(page?: number, itemsPerPage?: number): Observable<PaginatedResult<User[]>> {
const url = this.baseUrl + '/users/';
const paginatedResult: PaginatedResult<User[]> = new PaginatedResult<User[]>();
let params = new HttpParams();
if (page != null && itemsPerPage != null) {
params = new HttpParams()
.set('pageNumber', page.toString())
.set('pageSize', itemsPerPage.toString());
}
return this.http.get<User[]>(this.baseUrl + '/users', { observe: 'response', params})
.pipe(
map(response => {
paginatedResult.result = response.body;
if (response.headers.get('Pagination') != null) {
paginatedResult.pagination = JSON.parse(response.headers.get('Pagination'));
}
return paginatedResult;
})
);
}
в конфигурации Cors Backend я сделал:
app.UseCors(p=>p.AllowAnyHeader().AllowAnyMethod().AllowCredentials());
![enter image description here](https://i.stack.imgur.com/t1U5E.png)