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

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
主站蜘蛛池模板: 武穴市| 南陵县| 闽侯县| 治县。| 清水县| 贺州市| 台南县| 安陆市| 东丰县| 老河口市| 庆安县| 武功县| 临沭县| 元朗区| 新密市| 城固县| 道孚县| 靖州| 建湖县| 岳阳县| 华容县| 潮安县| 渝北区| 金塔县| 齐齐哈尔市| 大英县| 辽源市| 方正县| 潜山县| 贺州市| 马关县| 元朗区| 泾阳县| 霸州市| 荣成市| 泾川县| 喀喇沁旗| 彰武县| 渑池县| 阳原县| 洞口县|