diff --git a/vlib/net/urllib/urllib.v b/vlib/net/urllib/urllib.v index 6333422ad7..3a617dc863 100644 --- a/vlib/net/urllib/urllib.v +++ b/vlib/net/urllib/urllib.v @@ -303,13 +303,9 @@ fn escape(s string, mode EncodingMode) string { } // A URL represents a parsed URL (technically, a URI reference). -// // The general form represented is: -// // [scheme:][//[userinfo@]host][/]path[?query][#fragment] -// // URLs that do not start with a slash after the scheme are interpreted as: -// // scheme:opaque[?query][#fragment] // // Note that the path field is stored in decoded form: /%47%6f%2f becomes /Go/. @@ -333,6 +329,11 @@ pub mut: fragment string // fragment for references, without '#' } +// debug returns a string representation of *ALL* the fields of the given URL +pub fn (url &URL) debug() string { + return 'URL{\n scheme: $url.scheme\n opaque: $url.opaque\n user: $url.user\n host: $url.host\n path: $url.path\n raw_path: $url.raw_path\n force_query: $url.force_query\n raw_query: $url.raw_query\n fragment: $url.fragment\n}' +} + // user returns a Userinfo containing the provided username // and no password set. pub fn user(username string) &Userinfo {