classafBedSheet::BedClient
sys::Obj afBedSheet::BedClient
For testing: Make (fake) http calls against BedServer. Unlike WebClient
, BedClient
is designed for re-use, it auto tracks your Cookies
and lets you inspect your session.
@since 1.0.4
Str:Cookie cookies := Utils.makeMap(Str#, Cookie#)
The cookies currently amassed by this client. Currently they are not cleared / deleted when max-age runs out.
- get
BedClientRes get(Uri uri, Str method := "GET")
Makes a (fake) http request against the BedServer and returns the response.
- headers
Str:Str headers := Utils.makeMap(Str#, Str#)
The http headers to be sent on the next request. These are cleared after each request.
- make
new make(BedServer bedServer)
Create a BedClient attached to the given BedServer
- session
WebSession? session := BedSession.<ctor>() { private set }
The session used by the client. Returns
null
if it has not yet been created.- shutdown
Void shutdown()
Shuts down the associated
BedServer
- version
Version version := Version.<ctor>("1.1")
The HTTP version this client should announce to the server. Defaults to
HTTP 1.1