http.HandleFunc("/hello/", hello.Hello)
请不要推荐第三方包
如上所示,net/http建立一个简单的路由来处理http请求。但是要实现restful API,要怎么写呢?
http://127.0.0.1:8080/hello get post delete modify这种
更多评论
```
switch req.Method {
case http.MethodGet:
// deal with GET
case http.MethodPost:
// deal with POST
// ...
}
```
#1