Created
March 28, 2018 10:03
-
-
Save zxh/85f4e6824efda426f50d5cb43d296aef to your computer and use it in GitHub Desktop.
goalng url encode, query param encode, path escape, query escape, space escape
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/url" | |
) | |
func main() { | |
fmt.Println("Path参数中对空格的转义:"+url.PathEscape("hello world")) | |
fmt.Println("Query参数中对空格的转义:"+url.QueryEscape("hello world")) | |
fmt.Println("Path参数中对➕的转义:"+url.PathEscape("hello world+abc")) | |
fmt.Println("Query参数中对➕的转义:"+url.QueryEscape("hello world+abc")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment