Skip to main content
zerotal

Documentation


Documentation / @zerotal/core / http / uri

Function: uri()

uri(value?): Uri

Defined in: http/Uri.ts:488

Fluent URI helper. Pass a URL string to build from it, or call with no arguments to start from the current request URL.

Parameters

value?

string | Uri

Returns

Uri

Example

uri("https://example.com/p?x=1").withQuery({ x: 2 }).value();
uri().withoutQuery(["page"]).value();          // current URL, page param dropped
uri().intended("/dashboard").redirect();       // redirect to the stored intended URL