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

Parameter | Description
--- | ---
`url` | Absolute HTTP or HTTPS URL as `String` or `URL`.
`method` | HTTP method. Empty means `GET`.
`headers` | Optional request headers.
`body` | Optional request body.

Example

    import klyn.net

    request = HttpRequest("https://example.com", "GET")
    print(request.url.host)