Skip to content

RequestOptions

[Source]

Builder options available for all HTTP request methods.

Provides methods for setting headers, query parameters, and authentication. Use build() to produce the final HTTPRequest val.

Methods that accept a body (POST, PUT, PATCH, DELETE, OPTIONS) return RequestOptionsWithBody instead, which extends this interface with body-setting methods.

interface ref RequestOptions

Public Functions

[Source]

Add a header to the request.

fun ref header(
  hdr_name: String val,
  hdr_value: String val)
: RequestOptions ref

Parameters

Returns


query

[Source]

Add a query parameter. Parameters are percent-encoded in build().

fun ref query(
  key: String val,
  value: String val)
: RequestOptions ref

Parameters

Returns


basic_auth

[Source]

Set the Authorization header using HTTP Basic authentication.

fun ref basic_auth(
  username: String val,
  password: String val)
: RequestOptions ref

Parameters

Returns


bearer_auth

[Source]

Set the Authorization header using a Bearer token.

fun ref bearer_auth(
  token: String val)
: RequestOptions ref

Parameters

Returns


build

[Source]

Build the final HTTPRequest val.

fun ref build()
: HTTPRequest val

Returns