func getVal(r *http.Request, key string) string {
q := r.URL.Query()
return q.Get(key)
}
func handler(w http.ResponseWriter, r *http.Request) {
...
case "/SetName":
tmp := getVal(r, "name")
fmt.Printf("name=%s len=%d\n", tmp, len(tmp))
...
}
func main() {
..
http.HandleFunc("/", handler)
err := http.ListenAndServe("0.0.0.0:9092", nil)
if err != nil {
printf(ERR, "%v\n", err)
}
}
When i try to call "curl http://localhost:9092/SetName?name=is#victor"
server prints "is", looks as "Get" drops the rest after "#" ...
How can i handle this problem in server-side code without passing "special
sequences" in url?
Thanks,
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.