URL
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:3182
The URL interface is used to parse, construct, normalize, and encode URL.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new URL(
url,base?):URL
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:3183
Parameters
Section titled “Parameters”string | URL
string | URL
Returns
Section titled “Returns”URL
Properties
Section titled “Properties”hash:
string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:3255
The hash property of the URL interface is a string containing a '#' followed by the fragment identifier of the URL.
host:
string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:3219
The host property of the URL interface is a string containing the host, which is the URL.hostname, and then, if the port of the URL is nonempty, a ':', followed by the URL.port of the URL.
hostname
Section titled “hostname”hostname:
string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:3225
The hostname property of the URL interface is a string containing either the domain name or IP address of the URL.
href:
string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:3189
The href property of the URL interface is a string containing the whole URL.
origin
Section titled “origin”
readonlyorigin:string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:3195
The origin read-only property of the URL interface returns a string containing the Unicode serialization of the origin of the represented URL.
password
Section titled “password”password:
string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:3213
The password property of the URL interface is a string containing the password component of the URL.
pathname
Section titled “pathname”pathname:
string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:3237
The pathname property of the URL interface represents a location in a hierarchical structure.
port:
string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:3231
The port property of the URL interface is a string containing the port number of the URL.
protocol
Section titled “protocol”protocol:
string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:3201
The protocol property of the URL interface is a string containing the protocol or scheme of the URL, including the final ':'.
search
Section titled “search”search:
string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:3243
The search property of the URL interface is a search string, also called a query string, that is a string containing a '?' followed by the parameters of the URL.
searchParams
Section titled “searchParams”
readonlysearchParams:URLSearchParams
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:3249
The searchParams read-only property of the access to the [MISSING: httpmethod(‘GET’)] decoded query arguments contained in the URL.
username
Section titled “username”username:
string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:3207
The username property of the URL interface is a string containing the username component of the URL.
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON():
string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:3263
The toJSON() method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as js-nolint toJSON() None.
Returns
Section titled “Returns”string
toString()
Section titled “toString()”toString():
string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:3257
Returns
Section titled “Returns”string