set_scheme


Description:

public void set_scheme (string scheme)

Sets this's scheme to scheme.

This will also set this's port to the default port for scheme, if known.

Example: Set and get the scheme:

public static int main (string[] args) {
Soup.URI uri = new Soup.URI ("http://username:password@localhost:8088/foo/bar.html?foo=f&bar=b#frag");

// Output: ``Scheme: http``
unowned string scheme = uri.get_scheme ();
print ("Scheme: %s\n", scheme);

// Output: ``URI: https://username@localhost/foo/bar.html?foo=f&bar=b#frag``
uri.set_scheme ("https");
string uri_str = uri.to_string (false);
print ("URI: %s\n", uri_str);

return 0;
}

valac --pkg libsoup-2.4 uri-scheme.vala

Parameters:

this

a URI

scheme

the URI scheme