klyn.net.HttpRequest.HttpRequest
constructor

    public HttpRequest(url as Object,
    method as String = "GET",
    headers as Map<String, String> = null,
    body as Object = null) throws Exception:

Description

Creates an immutable HTTP request.

Parameters

- url Absolute HTTP or HTTPS URL as `String` or `URL`.
- method HTTP method. Empty means `GET`.
- headers Optional request headers.
- body Optional request body. ```klyn import klyn.net request = HttpRequest("https://example.com", "GET") print(request.url.host) ```