HttpReq models the request side of an XMLHttpRequest instance.
Slots
- asyncSource
-
Bool async := true
If true then perform this request asynchronously. Defaults to
true
- headersSource
-
Str:Str headers := [Str:Str][:]
The request headers to send.
- makeSource
-
new make(Str uri)
Create a new HttpReq instance with for the given Uri.
- methodSource
-
Str method := "POST"
The HTTP method to use. Defaults to
POST
. - sendSource
-
Void send(Str content, |HttpRes| c)
Send the request with the specificed content, after receiving the response, call the given closure with the resulting HttpRes.
- sendFormSource
-
Void sendForm(Str:Str form, |HttpRes| c)
Send the request with the specified name/value pairs as an HTML form submission, and call the given closure with the resulting HttpRes response.
- uriSource
-
Str uri
The Uri to send the request.