mutateRequest
Creates a new HttpRequest based on provided HttpRequest from a given builder lambda, using Kotlin DSL style.
This function allows for a more expressive, English-like syntax when creating an HttpRequest. It accepts a lambda with HttpRequest.Builder as its receiver, allowing the methods of HttpRequest.Builder to be called within the lambda without qualifying them.
This function is part of a DSL (Domain-Specific Language), which allows for clearer and more concise code.
Example usage:
val newRequest = mutateRequest(oldRequest) {
url("https://www.newurl.com/")
}
This example creates a new HttpRequest with modified url.
Return
The constructed HttpRequest.
Important: This is a Public Preview API. It may be changed or removed at any time.
Parameters
HttpRequest to be used as a template for creating new HttpRequest.
A builder lambda used to configure the HttpRequest.