queryParams

Applies a configuration block to the query parameters of the URL.

This function uses a Kotlin domain-specific language (DSL) style to allow for a more expressive, English-like configuration of query parameters. It accepts a lambda with HttpUrlBuilder as its receiver, allowing the methods of HttpUrlBuilder to be called within the lambda without qualifying them.

Example usage:

url {
...
queryParams {
add("param1", "value1")
add("param2", "value2")
}
}

This example adds two query parameters to the URL.

Return

the updated HttpUrlBuilder.

Parameters

init

the lambda function in which HttpUrlBuilder functions can be invoked.