Slots
- asyncSource
-
Bool async := true
If true then perform this request asynchronously. Defaults to
true
-
private native Str encodeForm(Str:Str form)
Encode the form map into a value URL-encoded string.
- getSource
-
Convenience for
send("GET", "", c)
. - headersSource
-
Str:Str headers := [Str:Str][:]
The request headers to send.
- makeSource
-
new make(|This|? f)
Create a new HttpReq instance.
- postSource
-
Void post(Str content, |HttpRes| c)
Convenience for
send("POST", content, c)
. - postFormSource
-
Void postForm(Str:Str form, |HttpRes| c)
Post the
form
map as a HTML form submission. Formats the map into a valid url-encoded content string, and setsContent-Type
header toapplication/x-www-form-urlencoded
. - sendSource
-
native Void send(Str method, Str content, |HttpRes| c)
Send a request with the given content using the given HTTP method (case does not matter). After receiving the response, call the given closure with the resulting HttpRes object.
- uriSource
-
Uri uri := `#`
The Uri to send the request.