urlesc – github.com/PuerkitoBio/urlesc Index | Files

package urlesc

import "github.com/PuerkitoBio/urlesc"

Package urlesc implements query escaping as per RFC 3986. It contains some parts of the net/url package, modified so as to allow some reserved characters incorrectly escaped by net/url. See https://github.com/golang/go/issues/5684

Index

Functions

func Escape

func Escape(u *url.URL) string

Escape reassembles the URL into a valid URL string. The general form of the result is one of:

scheme:opaque
scheme://userinfo@host/path?query#fragment

If u.Opaque is non-empty, String uses the first form; otherwise it uses the second form.

In the second form, the following rules apply:

func QueryEscape

func QueryEscape(s string) string

QueryEscape escapes the string so it can be safely placed inside a URL query.

Source Files

urlesc.go

Version
v0.0.0-20170810143723-de5bf2ad4578 (latest)
Published
Aug 10, 2017
Platform
darwin/amd64
Imports
3 packages
Last checked
now

Tools for package owners.