Target filter
Search Kotlin docs
  • Platforms
  • Tealium Prism Kotlin
core/com.tealium.prism.core.api.network/HttpRequest/Builder

Builder

class Builder

Builder helper class for constructing HttpRequests.

Although this class can be created directly, there are some additional helper methods to start the builder process: HttpRequest.get and HttpRequest.post that will prepopulate the Builder with the given parameters.

Parameters

url

required destination; the build method will throw if this is invalid

method

required http method for making the request

See also

HttpRequest.Companion.get
HttpRequest.Companion.post

Constructors

Builder
Link copied to clipboard
constructor(url: URL, method: HttpMethod)
constructor(url: String, method: HttpMethod)

Functions

additionalHeaders
Link copied to clipboard
fun additionalHeaders(additionalHeaders: Map<String, String>?): HttpRequest.Builder

Sets multiple HTTP headers at once for the outgoing request.

body
Link copied to clipboard
fun body(dataObject: DataObject?): HttpRequest.Builder
fun body(body: String?): HttpRequest.Builder

Sets the request body that needs to be sent.

build
Link copied to clipboard
fun build(): HttpRequest

Constructs the HttpRequest using the parameters given to the builder.

description
Link copied to clipboard
fun description(): String
etag
Link copied to clipboard
fun etag(etag: String?): HttpRequest.Builder

Sets an optional etag value for a previously cached value.

gzip
Link copied to clipboard
fun gzip(shouldGzip: Boolean): HttpRequest.Builder

Sets whether or not the outbound request will be GZipped prior to sending.

header
Link copied to clipboard
fun header(field: String, value: String): HttpRequest.Builder

Sets an HTTP header for the outgoing request.

Generated by Dokka
(c) Tealium 2026