klyn.net.HttpRequest.withMethod
method

    public withMethod(method as String) as HttpRequest throws Exception:

Description

Returns a copy with a different HTTP method.

Parameters

Parameter | Description
--- | ---
`method` | HTTP method. Empty means `GET`.

Returns

Updated request.

Throws

- Exception if request validation, serialization, network transport, TLS handling, or response creation fails.

Example

    import klyn.net

    request = HttpRequest("https://example.com").withMethod("DELETE")
    print(request.method)