Standard library
URL
Parse and format http(s) URLs.
Introduction
Parse and format http(s) URLs. Import std/net/url to bind the module as url. Call free functions as url.name(...). Struct methods use a receiver value.
/ std/net/url
This page is the package reference for std/net/url. Private helpers used only by co-located tests are not listed.
Functions
Free functions on url. Each function has a short description, an example, then parameters and return shape.
parse
Parses an http(s) URL into product fields. Call form: url.parse(s).
/ std/net/url
$ u = url.parse("http://example.com/a")Parameters: s: URL string. Returns: Product with scheme, host, path, and related fields.
format
Formats a URL product back to a string. Call form: url.format(scheme, host, port, path).
/ std/net/url
$ s = url.format(u)
Parameters: u: URL product. Returns: URL string.