Skip to content

Response.functions.toHeadersRecord

fx-fetch


fx-fetch / Response / toHeadersRecord

toHeadersRecord(self): object

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

Gets the headers of the response.

Response

object

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

0.1.0