Requester
The Requester class is useful to communicate with backend based on the SpringBoot framework
Author
N7ghtm4r3 - Tecknobit
Parameters
The host address where is running the backend
The user identifier
The user token
Whether the requester is still in development and who is developing needs the log of the requester's workflow, if it is enabled all the details of the requests sent and the errors occurred will be printed in the console
Time to keep alive request then throw the connection refused error
The error to send when a connection error occurred
Whether bypass the SSL certificates validation, this for example when is a self-signed the certificate USE WITH CAUTION
Constructors
Properties
interceptorAction
The callback of the interceptor to execute when a request has been sent, if not specified is `null** by default and no interceptions will be executed
ktorClient
the HTTP client used to send the stats and the performance data
loggerMutex
the mutex used to log atomically the log messages if debugMode is true
`mustValidateCertificates** flag whether the requests must validate the SSL certificates, this for example when the SSL is a self-signed certificate
Functions
Method used to attach a new interceptor to the Requester to execute it when a request has been sent
Method used to change, during the runtime for example when the session changed, the host address to make the requests
Method used to clear the current session of the requester, for example, after user logged out or changed the auth credentials
Method used to set the RESPONSE_STATUS_KEY to send when an error during the connection occurred
Method used to create the query with the pagination parameters
Method used to execute a RequestMethod.DELETE request to the backend
Method used to execute a multipart request to the backend
Method used to execute a request to the backend
Method used to execute the interceptorAction if it is specified by the attachInterceptorOnRequest method
Method used to log the current headers used in the requests
Method used to prepare the details of the request to execute
Method used to print a JsonObject request part in pretty format
Method used to set the user credentials used to make the authenticated requests