Skip to content

Request.functions.toJsHeaders

fx-fetch


fx-fetch / Request / 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.

Request

Headers

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