# UnityWebRequest：HTTP/1.1 413 请求实体过大

- **ID:** `unity/unitywebrequest-error-http-413`
- **领域:** unity
- **类别:** network_error
- **错误码:** `413`
- **验证级别:** ai_generated
- **修复率:** 90%

## 根因

服务器拒绝了上传或下载，因为负载超过了服务器配置的最大允许大小，通常是由于过大的资源包或 JSON 数据。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Unity 2022.3.25f1 | active | — | — |
| Unity 2023.3.0b3 | active | — | — |
| Unity 2021.3.40f1 | active | — | — |

## 解决方案

1. ```
   Split the upload into multiple smaller chunks using a custom chunked upload implementation, or increase the server's max request size (e.g., in ASP.NET set maxRequestBodySize in web.config).
   ```
2. ```
   Compress the payload before sending using GZip/Deflate and set Content-Encoding header. Ensure server supports decompression.
   ```

## 无效尝试

- **** — Timeout controls how long to wait for a response, not the payload size limit. (95% 失败率)
- **** — The 413 error is about request body size, not the HTTP method. (90% 失败率)
- **** — Compression affects transfer encoding, not the entity size limit. (85% 失败率)
