Douyin open platform, upload video to file server, response: 413 Request Entity Too Large investigation and analysis
1. Douyin open platform, upload video to file server, file size: 2.10 GB. Response: 413 Request Entity Too Large. as shown in Figure 1
<!docType html public "-//ietf//dtd html 2.0//en"> <html> <head> <title>413 request entity too large</title> </head> <body bgcolor="white"> <h1>413 request entity too large</h1> <p> the requested resource does not allow request data with the requested method or the amount of data provided in The request exceeds the capacity limit. <hr />Powered by Tengine </body> </html>
2. View the documentation, Douyin open platform – Open API – Video Management – Douyin – Create Video – Upload video: https://open.douyin.com/platform/doc/6848798087398295555 . Video file requirements: The size of the video file should not exceed 128M, and the duration is less than 15 minutes.
3. Douyin open platform, upload video to file server, file size: 136 MB. Response: 502 Bad Gateway. as shown in Figure 2
4. Douyin open platform, upload video to file server, file size: 117 MB. Response: 200. Upload was successful. Time-consuming: 1 m 7.02 s. as shown in Figure 3
5. Note for the official document: It is recommended to use sharding upload for videos over 50M, which can reduce the failure caused by the gateway timeout. Videos over 128M must be uploaded in shards. The total size of the video is within 4GB. A single shard is recommended to 20MB, the smallest is 5MB. The implementation logic of subsequent uploaded videos: No matter the size, the video is uploaded in shards, and the size of a single shard is 100 MB.


