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

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
主站蜘蛛池模板: 米脂县| 济南市| 牙克石市| 东兰县| 镇巴县| 雷山县| 定州市| 兴城市| 甘德县| 疏勒县| 双峰县| 富阳市| 沿河| 广南县| 井冈山市| 邢台县| 安平县| 金沙县| 穆棱市| 三台县| 穆棱市| 南川市| 法库县| 玛曲县| 清水河县| 通海县| 兴海县| 博野县| 阿荣旗| 紫金县| 卓尼县| 丰镇市| 道真| 拉萨市| 大厂| 高陵县| 昆山市| 乾安县| 金寨县| 南陵县| 通州市|