@itwin/imodels-client-management
Version:
iModels API client wrapper for applications that manage iModels.
20 lines • 862 B
JavaScript
/** Default implementation for {@link HttpResponseHeaders} interface, which adapts `axios` HTTP response headers to headers expected by the iModels Client. */
export class AxiosResponseHeadersAdapter {
_response;
constructor(response) {
this._response = response;
}
get(headerName) {
// Directly manipulating headers object is deprecated.
// https://github.com/axios/axios?tab=readme-ov-file#-axiosheaders
if (this._response.headers.get instanceof Function)
return this._response.headers.get(headerName);
// It's most likely that header name is lowercase.
// https://axios-http.com/docs/res_schema
return this._response.headers[headerName.toLowerCase()];
}
getAll() {
return this._response.headers;
}
}
//# sourceMappingURL=AxiosResponseHeadersAdapter.js.map