官术网_书友最值得收藏!

Gorilla web toolkit

Now that we have covered how web Restful APIs work, it's time to understand how to best implement them in Go. The Go language comes with a very powerful web package in the standard library; Go also enjoys the support of numerous third-party packages. In this book, we will use a very popular Go web third-party toolkit called Gorilla web toolkit. The Gorilla web toolkit consists of a collection of Go packages that together helps build powerful web applications quickly and efficiently.

The key package in the Gorilla web toolkit ecosystem is called gorilla/mux. The mux package is described in the package documentation as a request router and dispatcher. This is basically a software component that accepts an incoming HTTP request, then decides what to do based on the nature of the request. For example, let's assume that a client sends an HTTP request to our web server. The HTTP router dispatcher component in our web server can then detect that the incoming request includes a GET method with a relative URL of ../events/id/1345. It will then retrieve the information of the event ID 1345 and send it back to the client.

主站蜘蛛池模板: 达尔| 常熟市| 乌鲁木齐县| 大荔县| 呼图壁县| 慈溪市| 北京市| 岚皋县| 德庆县| 宁都县| 阿克| 通山县| 长白| 衡水市| 德化县| 溆浦县| 三都| 舒城县| 茶陵县| 河间市| 获嘉县| 冕宁县| 额济纳旗| 平乐县| 六枝特区| 京山县| 威信县| 福贡县| 探索| 龙南县| 章丘市| 五河县| 金门县| 望都县| 海兴县| 无极县| 监利县| 衡水市| 台北市| 成都市| 汝城县|