Response.variables.appendHeaders
fx-fetch / Response / appendHeaders
Variable: appendHeaders()
Section titled “Variable: appendHeaders()”
constappendHeaders: {(self,headers):Response; (headers): (self) =>Response; }
Defined in: packages/fx-fetch/src/Response/appendHeaders.ts:33
Merges new headers into a Response, appending values to existing headers.
Call Signature
Section titled “Call Signature”(
self,headers):Response
Merges new headers into a Response, appending values to existing headers.
Parameters
Section titled “Parameters”headers
Section titled “headers”HeadersInput
Returns
Section titled “Returns”Example
Section titled “Example”import { Response } from 'fx-fetch';
const response = Response.make({ url: 'https://api.example.com' });const responseWithMergedHeaders = Response.appendHeaders(response, { 'Authorization': 'Bearer token', 'Content-Type': 'application/json'});0.1.0
Call Signature
Section titled “Call Signature”(
headers): (self) =>Response
Merges new headers into a Response, appending values to existing headers.
Parameters
Section titled “Parameters”headers
Section titled “headers”HeadersInput
Returns
Section titled “Returns”(
self):Response
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Example
Section titled “Example”import { Response } from 'fx-fetch';import { pipe } from 'effect';
const response = Response.make({ url: 'https://api.example.com' });
const responseWithMergedHeaders = pipe( response, Response.appendHeaders({ 'X-API-Version': 'v2', 'X-Client-ID': 'webapp' }));0.1.0
Example
Section titled “Example”import { Response } from 'fx-fetch';const response = Response.make({ url: 'https://api.example.com' });const responseWithMergedHeaders = Response.appendHeaders(response, { 'Authorization': 'Bearer token', 'Content-Type': 'application/json'});0.1.0