# API Routing - HTTP Header

> Route API requests based on HTTP headers

- **Category**: Cloud
- **Subcategory**: aws
- **Canonical URL**: https://designpattern.fyi/patterns/aws_api_routing_http_header/

---

## Description
The HTTP Header Routing pattern routes API requests to different backend services based on HTTP headers in the request. This enables sophisticated routing decisions based on user context, API version, or other custom headers. It is useful for canary deployments, A/B testing, or routing based on user attributes.


## Use Cases
Use when you need to route requests based on HTTP headers for canary deployments, A/B testing, or user context-based routing.





## Trade-offs


### Advantages

- Flexible header-based routing

- Supports canary deployments and A/B testing

- Context-aware routing

- Enables sophisticated traffic management




### Considerations & Drawbacks

- Requires header management

- More complex than simple path routing

- Security considerations with header data







---
**Reference**: [Original Source](https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/api-routing-http.html)

