Added the rate limit middleware.
This commit is contained in:
1 parent
35b3b7953d
commit
2d86dff608
4 files changed
+326
No files matched your search
@@ -86,6 +86,17 @@ repeat {
|
||||
} while cursor != nil
|
||||
```
|
||||
|
||||
### Handling Rate Limits
|
||||
|
||||
Add `RateLimitMiddleware` before the authentication middleware to retry `429 Too Many Requests` responses:
|
||||
|
||||
```swift
|
||||
middlewares: [
|
||||
RateLimitMiddleware(),
|
||||
BearerAuthMiddleware { try await tokenProvider.token() }
|
||||
]
|
||||
```
|
||||
|
||||
## Supported Platforms
|
||||
|
||||
- iOS 14.0+
|
||||
|
||||
Reference in new issue
Block a user