Response.functions.toJsHeaders
fx-fetch / Response / toJsHeaders
Function: toJsHeaders()
Section titled “Function: 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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Headers
Example
Section titled “Example”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