RestClient Class
- java.
lang. Object - com.
microsoft. bot. restclient. RestClient
- com.
public final class RestClient
An instance of this class stores the client information for making REST calls.
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| void |
close()
Closes the HTTP client and recycles the resources associated. |
| void |
closeAndWait()
Closes the HTTP client, recycles the resources associated, and waits for 60 seconds for all the threads to be recycled. |
|
Service |
credentials() |
|
Custom |
headers() |
| okhttp3.OkHttpClient | httpClient() |
|
Log |
logLevel() |
| Builder |
newBuilder()
Create a new builder for a new Rest Client with the same configurations on this one. |
| Factory | responseBuilderFactory() |
| retrofit2.Retrofit | retrofit() |
|
Serializer |
serializerAdapter() |
|
Rest |
withLogLevel(LogLevel logLevel)
Set the current HTTP traffic logging level. |
Methods inherited from java.lang.Object
Method Details
close
public void close()
Closes the HTTP client and recycles the resources associated. The threads will be recycled after 60 seconds of inactivity.
closeAndWait
public void closeAndWait()
Closes the HTTP client, recycles the resources associated, and waits for 60 seconds for all the threads to be recycled.
Throws:
credentials
public ServiceClientCredentials credentials()
Returns:
headers
public CustomHeadersInterceptor headers()
Returns:
httpClient
public OkHttpClient httpClient()
Returns:
logLevel
public LogLevel logLevel()
Returns:
newBuilder
public RestClient.Builder newBuilder()
Create a new builder for a new Rest Client with the same configurations on this one.
Returns:
responseBuilderFactory
public ResponseBuilder.Factory responseBuilderFactory()
Returns:
retrofit
public Retrofit retrofit()
Returns:
serializerAdapter
public SerializerAdapter serializerAdapter()
Returns:
withLogLevel
public RestClient withLogLevel(LogLevel logLevel)
Set the current HTTP traffic logging level.
Parameters:
Returns: