Request Size Limits
Maximum Request Sizes
Tyk supports forcing request size limits at the API and individual endpoint level. Tyk will reject any request that exceeds the size you set.
Note
Tyk Cloud Classic enforces a strict request size limit of 1MB an all inbound requests via our cloud architecture. This does not affect Multi-Cloud users.
Max Request Size with the Dashboard
To enforce a request size from your API Endpoint Designer:
-
Click ADD ENDPOINT.
-
Fill in the endpoint pattern with the details of the request (e.g.
GET widgets/{wildcard}
). -
Select Request Size Limit from the “Plugins” drop down.
-
Set the size limit in bytes.
-
Save the API.
Max Request Size with API Definition
To set up this middleware in your API Definition, simply add a new section to the extended_paths
block of your API Definition configuration called size_limits
:
"size_limits": [
{
"path": "widget/{id}",
"method": "PUT",
"size_limit": 25
}
]
The size limit must be in in bytes.
Global size limiting for your API
To add an API size limit, simply add:
"global_size_limit": 500
To the version element of your API Definition, the global size limit will be checked before the specific path-based one.