HttpRequest¶
Import: import system.net;
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
HttpRequest¶
Mutable request description; sending snapshots URL, headers, options, and body bytes.
method¶
HTTP method, restricted to GET/POST/PUT/PATCH/DELETE/HEAD/OPTIONS on all hosts.
url¶
Absolute http/https destination; credentials in URLs are rejected.
headers¶
Request headers; browsers reject forbidden names instead of silently ignoring them.
body¶
Byte body copied for each send; GET and HEAD require an empty body.
constructor¶
Creates a request with empty headers and body.
set_text¶
Replaces the body with UTF-8 bytes; adds no content-type header implicitly.