String renders the full URL. Path components and query parameters are URL encoded (aka percent-encoded) while the host prefix is included as given. The zero value renders as the empty string.
()
| 95 | // (aka percent-encoded) while the host prefix is included as given. The zero value |
| 96 | // renders as the empty string. |
| 97 | func (u *MutableSafeURL) String() string { |
| 98 | result := joinPathWithHostPrefix(u.prefix, u.components...) |
| 99 | if len(u.query) > 0 { |
| 100 | result += "?" + u.query.Encode() |
| 101 | } |
| 102 | return result |
| 103 | } |
| 104 | |
| 105 | // ImmutableSafeURL is a SafeURL that renders a fixed URL string verbatim. It exists |
| 106 | // so that a URL which was not built from percent-encoded components, such as a full |