Search results

There are no results.

std.net.http.test.RunningServer

type pub inline RunningServer

A handle to a running mock HTTP server.

Instance methods

prepare_client

Show source code
Hide source code
fn pub prepare_client(client: mut Client) {
  client.base_uri = Option.Some(uri)
  client.random = Random.from_int(0)
}
fn pub prepare_client(client: mut Client)

Prepares a Client so it redirects its requests to the mock server.

Using this method is preferred over manually populating a Client whenever possible.

uri

Show source code
Hide source code
fn pub uri -> Uri {
  @uri.clone
}
fn pub uri -> Uri

Returns a std.uri.Uri to use for connecting to the mock HTTP server.

This Uri should be used to populate the Client.base_uri field of a std.net.http.client.Client used to perform HTTP requests that need to be mocked.

Implemented traits

std.drop.

Drop

impl Drop for RunningServer