我想在golang中使用net/http包在get请求中发送文本字符串.但是我无法知道如何做到这一点.就像我想要点击以下网址:
"http://api.example.com/tutor?message=how can I do this"
Run Code Online (Sandbox Code Playgroud)
请让我知道我该怎么做.
我用的时候
http.HandleFunc("/", serveRest) //serveRest is the method to handle request
http.ListenAndServe("localhost:4000", nil)
Run Code Online (Sandbox Code Playgroud)
它将接受所有请求"/".如何限制它仅用于"localhost:4000"代替每个地址"localhost:4000/*"?
你们可以给我一个很好的Go教程吗?