peek_scheme


Description:

[ Version ( since = "2.66" ) ]
public static unowned string? peek_scheme (string uri)

Gets the scheme portion of a URI string.

[RFC 3986](https://tools.ietf.org/html/rfc3986section-3) decodes the scheme as:

URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
Common schemes include `file`, `https`, `svn+ssh`, etc.

Unlike parse_scheme, the returned scheme is normalized to all-lowercase and does not need to be freed.

Parameters:

uri

a valid URI.

Returns:

The ‘scheme’ component of the URI, or null on error. The returned string is normalized to all-lowercase, and interned via g_intern_string, so it does not need to be freed.