request method

TestRequest request(
  1. String path
)

Creates a request object for path that can be configured and executed later.

Use this method to create a configurable TestRequest object. Default values of this agent, such as headers and contentType, are set on the returned request. You may override default values in the returned request without impacting other requests.

The path will be appended to baseURL. Leading and trailing slashes are ignored.

Implementation

TestRequest request(String path) {
  final r = TestRequest._(_client)
    ..baseURL = baseURL
    ..path = path
    .._client = _client
    ..contentType = contentType;

  r.headers.addAll(headers);

  return r;
}