class dom::HttpReq

sys::Obj
  dom::HttpReq

@Js

Source

HttpReq models the request side of an XMLHttpRequest instance.

See pod doc for details.

async

Bool async := true

Source

If true then perform this request asynchronously. Defaults to true

get

Void get(|HttpRes| c)

Source

Convenience for send("GET", "", c).

headers

Str:Str headers := [Str:Str][:]

Source

The request headers to send.

make

new make(|This|? f)

Source

Create a new HttpReq instance.

post

Void post(Obj content, |HttpRes| c)

Source

Convenience for send("POST", content, c).

postForm

Void postForm(Str:Str form, |HttpRes| c)

Source

Post the form map as a HTML form submission. Formats the map into a valid url-encoded content string, and sets Content-Type header to application/x-www-form-urlencoded.

send

Void send(Str method, Obj? content, |HttpRes| c)

Source

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.

uri

Uri uri := `#`

Source

The Uri to send the request.