# Werkzeug 异常：400 错误请求：浏览器（或代理）发送了服务器无法理解的请求。

- **ID:** `python/flask-request-cookie-parse-error`
- **领域:** python
- **类别:** data_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

请求中的 Cookie 头格式错误，导致解析失败。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (80% 成功率)
   ```
   Use request.cookies.get('key') which returns None on parsing error? Actually, it raises; wrap in try/except BadRequest.
   ```
2. **** (70% 成功率)
   ```
   Validate the cookie header manually before accessing
   ```

## 无效尝试

- **** — Raises BadRequest; you need to handle it. (90% 失败率)
- **** — The request is invalid; you should return a 400. (60% 失败率)
