classafButter::ButterRequest

sys::Obj
  afButter::ButterRequest

The HTTP request.

body

Source

Body body := ...

The request body.

dump

Source

Str dump(Bool dumpBody := true)

Dumps a debug string that in some way resembles the full HTTP request.

headers

Source

HttpRequestHeaders headers := HttpRequestHeaders.<ctor>() { private set }

The HTTP headers to use for the next request. This map uses case insensitive keys.

make

Source

new make(Uri url, |This? f := null)

method

Source

Str method := "GET"

HTTP method to use for request. Defaults to "GET".

normaliseHost

Source

static Str normaliseHost(Uri url)

Returns a normalised host string from a URL.

setHeader

Source

This setHeader(Str name, Str? value)

Builder method for setting a header value.

setMethod

Source

This setMethod(Str method)

Builder method for setting the HTTP method.

stash

Source

Str:Obj? stash := ...

A temporary store for request data, use to pass data between middleware.

url

Source

Uri url

Url to use for request.

version

Source

Version version := Butter.http11

HTTP version to use for request. Defaults to HTTP 1.1

writeMultipartForm

Source

This writeMultipartForm(|MultipartForm formFunc)

Writes a Multipart Form to the body. Use to simulate file uploads.

request.writeMultipartForm |MultipartForm form| {
    form.writeJsonObj("meta", ["desc":"Awesome!"])
    form.writeFile("upload", `newGame.pod`.toFile)
}