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