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

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
主站蜘蛛池模板: 平顶山市| 珲春市| 炉霍县| 灵寿县| 红河县| 枣强县| 光山县| 牙克石市| 四会市| 呼伦贝尔市| 藁城市| 图木舒克市| 密山市| 双桥区| 南和县| 永泰县| 渝中区| 夏河县| 西青区| 稻城县| 嘉禾县| 义马市| 新宁县| 浦江县| 武乡县| 乳源| 上饶县| 抚松县| 玉树县| 衡阳市| 泗阳县| 改则县| 辰溪县| 临猗县| 罗定市| 金门县| 兴仁县| 陵川县| 桃源县| 措美县| 抚松县|