public class RateLimitInterceptor
extends java.lang.Object
implements okhttp3.Interceptor
Constructor and Description |
---|
RateLimitInterceptor(RateLimitsListener listener)
Create a new ratelimit interceptor.
|
Modifier and Type | Method and Description |
---|---|
okhttp3.Response |
intercept(okhttp3.Interceptor.Chain chain)
Intercept a http call.
|
public RateLimitInterceptor(RateLimitsListener listener)
listener
- an object to be informed once a rate limit header is encountered.java.lang.IllegalArgumentException
- if listener is null.public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws java.io.IOException
intercept
in interface okhttp3.Interceptor
chain
- the current chain of calls.java.io.IOException
- if something goes wrong.Copyright © 2019 Contentful, GmbH.. All Rights Reserved.