Skip to content

Request.functions.toHeadersRecord

fx-fetch


fx-fetch / Request / toHeadersRecord

toHeadersRecord(self): object

Defined in: packages/fx-fetch/src/Request/toHeadersRecord.ts:22

Gets the headers of the request.

Request

object

import { Request } from 'fx-fetch';
const request = Request.make({
url: 'https://api.example.com',
headers: { 'Content-Type': 'application/json' }
});
const headers = Request.toHeadersRecord(request);
console.log(headers); // { 'content-type': 'application/json' }

0.1.0