Skip to content

Response.functions.toJsHeaders

fx-fetch


fx-fetch / Response / toJsHeaders

toJsHeaders(self): Headers

Defined in: packages/fx-fetch/src/Response/toJsHeaders.ts:24

Converts a Response’s headers to a standard JavaScript Headers object.

Response

Headers

import { Response } from 'fx-fetch';
const response = Response.create('GET', '/api/users', {
'Content-Type': 'application/json',
'Authorization': 'Bearer token123'
});
const headers = toJsHeaders(response);
console.log(headers.get('Content-Type')); // 'application/json'

0.1.0