createGetRequest
Creates a new HttpRequest with GET HttpMethod 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 request = createGetRequest {
url("https://www.newurl.com/")
}
Content copied to clipboard
This example creates a new HttpRequest with the specified url and GET HttpMethod.
Return
The constructed HttpRequest.
Important: This is a Public Preview API. It may be changed or removed at any time.
Parameters
init
A builder lambda used to configure the HttpRequest.