10Duke Java Core
|
Interface for providing configured OkHttpClient instances ready to use.
An instance of this type is required by 10Duke SDK OAuth clients for making HTTP calls. This provider signature may also be utilized by other classes that interact with HTTP APIs.
Public Member Functions | |
OkHttpClient | provide () |
Provides an OkHttpClient instance. | |
Public Attributes | |
int | MAX_USER_AGENT_LEN = 1024 |
Maximum length for user agent values. | |
Pattern | VALID_USER_AGENT_REGEX = Pattern.compile("^[A-Za-z0-9\\-\\[\\]/_\\.,\\s]+$") |
A regex pattern that defines the criteria for valid user agent values. | |
OkHttpClient tenduke.sdk.core.service.OkHttpProvider.provide | ( | ) |
Provides an OkHttpClient instance.
int tenduke.sdk.core.service.OkHttpProvider.MAX_USER_AGENT_LEN = 1024 |
Maximum length for user agent values.
NOTE: it is a security measure to validate the length before using a regex matcher to validate the other aspects of validity.