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

Introducing httprouter, a lightweight HTTP router

httprouter, as the name suggests, routes the HTTP requests to particular handlers. Compared to the basic router, it has the following features:

  • Allows variables in the route paths
  • It matches the REST methods (GET, POST, PUT, and so on)
  • No compromising on performance

We are going to discuss these qualities in more detail in the following section. Before that, there are a few noteworthy points that make httprouter an even better URL router:

  • httprouter plays well with the inbuilt http.Handler
  • httprouter explicitly says that a request can only match to one route or none
  • The router's design encourages building sensible, hierarchical RESTful APIs
  •  You can build efficient static file servers
主站蜘蛛池模板: 射洪县| 巨野县| 正镶白旗| 商丘市| 抚松县| 陇南市| 利川市| 贡觉县| 荃湾区| 辉县市| 井冈山市| 清远市| 景洪市| 台南市| 高尔夫| 乐清市| 呼和浩特市| 万州区| 波密县| 额敏县| 喀喇| 东港市| 开原市| 江川县| 台湾省| 五家渠市| 商南县| 抚顺县| 叶城县| 合作市| 县级市| 昂仁县| 泽库县| 喜德县| 南安市| 漾濞| 罗源县| 安泽县| 吕梁市| 英超| 民勤县|