Added the rate limit middleware.
This commit is contained in:
1 parent
35b3b7953d
commit
2d86dff608
4 files changed
+326
No files matched your search
@@ -63,6 +63,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() }
|
||||
]
|
||||
```
|
||||
|
||||
## Topics
|
||||
|
||||
### API Client
|
||||
@@ -75,6 +86,10 @@ repeat {
|
||||
- ``BearerAuthMiddleware``
|
||||
- ``APIKeyTokenProvider``
|
||||
|
||||
### Rate Limiting
|
||||
|
||||
- ``RateLimitMiddleware``
|
||||
|
||||
### Generated Types
|
||||
|
||||
- ``Components``
|
||||
|
||||
Reference in new issue
Block a user