URL

    A URL is a type that can potentially contain the location of a resource on a remote server, the path of a local file on disk, or even an arbitrary piece of encoded data.

    struct URL

    You can construct URLs and access their parts. For URLs that represent local files, you can also manipulate properties of those files directly, such as changing the file’s last modification date. Finally, you can pass URLs to other APIs to retrieve the contents of those URLs. For example, you can use the URLSession classes to access the contents of remote resources, as described in URL Session Programming Guide.

    URLs are the preferred way to refer to local files. Most objects that read data from or write data to a file have methods that accept a URL instead of a pathname as the file reference. For example, you can get the contents of a local file URL as String by calling func init(contentsOf:encoding) throws, or as a Data by calling func init(contentsOf:options) throws.

    Citizens in Foundation

    Conformances

    Members

    Features

    Extension in AsyncHTTPClient

    Members

    • init?(httpURLWithSocketPath: String, uri: String)

      Initializes a newly created HTTP URL connecting to a unix domain socket path. The socket path is encoded as the URL’s host, replacing percent encoding invalid path characters, and will use the “http+unix” scheme.

    • init?(httpsURLWithSocketPath: String, uri: String)

      Initializes a newly created HTTPS URL connecting to a unix domain socket path over TLS. The socket path is encoded as the URL’s host, replacing percent encoding invalid path characters, and will use the “https+unix” scheme.