Skip to content
uencoder

URL

A URL (Uniform Resource Locator) is a string identifying the location of an Internet resource, comprising scheme, host, port, path, query, and fragment.

Purpose

It provides a uniform scheme for identifying and locating Internet resources.

Mechanism

Format: scheme://[user:pass@]host[:port]/path?query#fragment. Schemes include http/https/ftp. The host may be a domain name or IP. The query is a set of key-value pairs. The fragment identifies a position within the resource (never sent to the server). RFC 3986 defines the syntax.

Use cases

  • Web pages and API endpoints
  • Resource location and linking
  • RESTful API routing
  • File URIs

Examples

  • Input
    https://a.com:443/api?q=1#sec
    Output
    Each component parsed out

    RFC 3986

Common errors

Leaving special characters unencoded in a URL
Encode parameter values with encodeURIComponent

Related terms

Related tools

Related tutorials

References