g_uri_to_string (
  GUri* uri


Returns a string representing uri.

This is not guaranteed to return a string which is identical to the string that uri was parsed from. However, if the source URI was syntactically correct (according to RFC 3986), and it was parsed with G_URI_FLAGS_ENCODED, then g_uri_to_string() is guaranteed to return a string which is at least semantically equivalent to the source URI (according to RFC 3986).

If uri might contain sensitive details, such as authentication parameters, or private data in its query string, and the returned string is going to be logged, then consider using g_uri_to_string_partial() to redact parts.

Available since:2.66

Return value

Type: char*

A string representing uri, which the caller must free.

The caller of the method takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.