# julienschmidt/httprouter

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/julienschmidt-httprouter).**

17,121 stars · 1,459 forks · Go · BSD-3-Clause

## Links

- GitHub: https://github.com/julienschmidt/httprouter
- Homepage: https://pkg.go.dev/github.com/julienschmidt/httprouter
- awesome-repositories: https://awesome-repositories.com/repository/julienschmidt-httprouter.md

## Topics

`go` `golang` `http` `httprouter` `mux` `router`

## Description

httprouter is a high-performance HTTP request router for Go that maps incoming network requests to specific handler functions using a radix tree. It functions as a request dispatcher and path parameter parser, organizing URL paths in a tree structure to ensure efficient lookups.

The router specializes in capturing dynamic segments and catch-all wildcards from URL paths to pass directly into request handlers. It implements method-specific routing and automatically manages responses for unsupported HTTP methods.

The library covers broader capabilities including request normalization through trailing-slash redirects, static asset serving by mapping paths to the file system, and middleware integration for recovering from request panics.

## Tags

### Web Development

- [HTTP Routers](https://awesome-repositories.com/f/web-development/http-routers.md) — Implements a high-performance system for mapping network requests to handler functions based on URL patterns.
- [Radix Tree Routers](https://awesome-repositories.com/f/web-development/routing-systems/routing/matching-algorithms/radix-tree-routers.md) — Uses a high-performance radix tree structure to map URL paths to handlers with constant-time lookup.
- [HTTP Request Handlers](https://awesome-repositories.com/f/web-development/backend-development/web-frameworks/routing-request-handling/http-request-handlers.md) — Efficiently routes URL paths to specific handler functions using a radix tree. ([source](https://github.com/julienschmidt/httprouter/blob/master/tree_test.go))
- [High-Performance HTTP Servers](https://awesome-repositories.com/f/web-development/high-performance-http-servers.md) — Provides high-performance HTTP routing using a fast radix tree for low latency and high throughput.
- [Request Parameter Parsers](https://awesome-repositories.com/f/web-development/request-parameter-parsers.md) — Extracts dynamic path segments and catch-all wildcards from URLs to pass as parameters to handlers.
- [RESTful API Frameworks](https://awesome-repositories.com/f/web-development/restful-api-frameworks.md) — Maps dynamic URL segments and named parameters to controllers for building scalable REST API endpoints.
- [HTTP Routing](https://awesome-repositories.com/f/web-development/routing-systems/http-routing.md) — Maps incoming requests to specific handlers based on path matching and HTTP methods using a search tree. ([source](https://github.com/julienschmidt/httprouter#readme))
- [Dynamic Segment Extraction](https://awesome-repositories.com/f/web-development/routing-systems/routing/parameter-handling-utilities/path-parameter-converters/dynamic-segment-extraction.md) — Captures dynamic path segments using named wildcards to pass specific values directly into request handlers. ([source](https://github.com/julienschmidt/httprouter#readme))
- [Method-Specific Trees](https://awesome-repositories.com/f/web-development/http-methods/method-specific-trees.md) — Implements separate routing trees for each HTTP method to avoid unnecessary checks during path traversal.
- [Path Normalization](https://awesome-repositories.com/f/web-development/path-normalization.md) — Redirects requests to correct URLs by removing trailing slashes and redundant path elements. ([source](https://github.com/julienschmidt/httprouter/blob/master/README.md))
- [Request Middleware](https://awesome-repositories.com/f/web-development/request-middleware.md) — Includes middleware for intercepting requests to handle panics and manage custom error responses.
- [URL Normalization Utilities](https://awesome-repositories.com/f/web-development/url-normalization-utilities.md) — Redirects clients to correct paths by fixing trailing slashes and performing case-insensitive lookups. ([source](https://github.com/julienschmidt/httprouter#readme))
- [URL Redirections](https://awesome-repositories.com/f/web-development/url-routing/redirection-rules/geographic-redirection/url-redirections.md) — Automatically normalizes request paths by issuing redirects when trailing slash mismatches occur.

### Development Tools & Productivity

- [Path Variable Extractors](https://awesome-repositories.com/f/development-tools-productivity/dynamic-variable-evaluators/path-variable-extractors.md) — Maps requests to handlers using named parameters and catch-all wildcards within the URL path. ([source](https://github.com/julienschmidt/httprouter/blob/master/tree.go))
- [Resource Path Matching](https://awesome-repositories.com/f/development-tools-productivity/file-pattern-matching/resource-path-matching.md) — Supports catch-all wildcard patterns to capture all remaining segments of a URL path. ([source](https://github.com/julienschmidt/httprouter/blob/master/tree_test.go))

### Operating Systems & Systems Programming

- [Zero-Allocation Path Parsing](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/process-and-memory-management/memory-management/allocation-strategies/dynamic-memory-allocation/zero-allocation-conversions/zero-allocation-path-parsing.md) — Parses path variables directly from the request URI slice to minimize memory allocations during routing.

### Part of an Awesome List

- [Web Frameworks](https://awesome-repositories.com/f/awesome-lists/devtools/web-frameworks.md) — High-performance HTTP request router.
