MockServerHttpRequest constructor

MockServerHttpRequest(
  1. HttpMethod method,
  2. String target, {
  3. HttpHeaders? headers,
})

A method request to target: a path with an optional query (/books?q=dune), resolved against http://localhost, or a full URL (https://shop.test/books, which also makes isSecure true). headers start empty unless given.

Implementation

MockServerHttpRequest(this.method, String target, {HttpHeaders? headers})
  : uri = Uri.parse('http://localhost').resolve(target),
    headers = headers ?? HttpHeaders();