angular2 service request header response for X-Pagination-Page-Count

喜欢而已 提交于 2019-12-11 17:56:46

问题


I am using angular2 service to get data response from yii2 api. In browser network tab it showing all required response but when I am trying to get it directly from component like

response.headers.get('X-Pagination-Page-Count') 

Then it's not showing anything. except only showing content-type in response header via code. but can't get a function response. below is my service function.

getResponse(endpointUrl: string): Observable<any> {

    const url = url;

    return this._http.get(url)
        .catch((err) => this._handleError(err))
        .take(1)
        .map((res: Response) => res);
}

this is response image.

来源:https://stackoverflow.com/questions/47497390/angular2-service-request-header-response-for-x-pagination-page-count

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!