Request.variables.unsafeSetUrl
fx-fetch / Request / unsafeSetUrl
Variable: unsafeSetUrl()
Section titled “Variable: unsafeSetUrl()”
constunsafeSetUrl: {(self,url):Request; (url): (self) =>Request; }
Defined in: packages/fx-fetch/src/Request/unsafeSetUrl.ts:39
Unsafely sets the URL of a Request (throws on invalid).
Call Signature
Section titled “Call Signature”(
self,url):Request
Unsafely sets the URL of a Request (throws on invalid).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Example
Section titled “Example”import { Request } from 'fx-fetch';
const request = Request.make({ url: 'https://api.example.com' });const requestWithNewUrl = Request.unsafeSetUrl(request, 'https://api.newdomain.com');0.1.0
Call Signature
Section titled “Call Signature”(
url): (self) =>Request
Unsafely sets the URL of a Request (throws on invalid).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”(
self):Request
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Example
Section titled “Example”import { Request } from 'fx-fetch';import { pipe } from 'effect';
const request = Request.make({ url: 'https://api.example.com' });
const requestWithNewUrl = pipe( request, Request.unsafeSetUrl('https://api.newdomain.com'));0.1.0
Example
Section titled “Example”import { Request } from 'fx-fetch';
const request = Request.make({ url: 'https://api.example.com' });const requestWithNewUrl = Request.unsafeSetUrl(request, 'https://api.newdomain.com');0.1.0