RequestBuilder

open class RequestBuilder

Author

Umang Chamaria

Constructors

RequestBuilder
Link copied to clipboard
open fun RequestBuilder(uri: Uri, requestType: RequestBuilder.RequestType)
Builder to build a request to make an API call

Types

RequestType
Link copied to clipboard
enum RequestType
Supported Request types.

Functions

addBody
Link copied to clipboard
open fun addBody(jsonBody: JSONObject): RequestBuilder
Add body to the request.
addHeader
Link copied to clipboard
open fun addHeader(headerKey: String, headerValue: String): RequestBuilder
Key value pair to be added as a header.
addHeaders
Link copied to clipboard
open fun addHeaders(headersMap: Map<String, String>): RequestBuilder
Set of headers to be added to the headers.
build
Link copied to clipboard
open fun build(): Request
disableRequestLogging
Link copied to clipboard
open fun disableRequestLogging(): RequestBuilder
enableEncryption
Link copied to clipboard
open fun enableEncryption(@NonNull() encryptionKey: String): RequestBuilder
setConnectionTimeOut
Link copied to clipboard
open fun setConnectionTimeOut(connectionTimeOut: Int): RequestBuilder

Properties

contentType
Link copied to clipboard
private open var contentType: String