Request.functions.toJsHeaders
fx-fetch / Request / toJsHeaders
Function: toJsHeaders()
Section titled “Function: toJsHeaders()”toJsHeaders(
self):Headers
Defined in: packages/fx-fetch/src/Request/toJsHeaders.ts:24
Converts a Request’s headers to a standard JavaScript Headers object.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Headers
Example
Section titled “Example”import { Request } from 'fx-fetch';
const request = Request.create('GET', '/api/users', { 'Content-Type': 'application/json', 'Authorization': 'Bearer token123'});
const headers = toJsHeaders(request);console.log(headers.get('Content-Type')); // 'application/json'0.1.0