FunctionRequestPostProcessor class final

A RequestPostProcessor made from a function, for a one-off change that does not need a class.

// The request arrives as if through an HTTPS proxy.
final viaProxy = FunctionRequestPostProcessor(
  (request) => request..headers.set('X-Forwarded-Proto', 'https'),
);
Implemented types

Constructors

FunctionRequestPostProcessor(MockServerHttpRequest process(MockServerHttpRequest request))
A post-processor that calls process on each request.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
process → MockServerHttpRequest Function(MockServerHttpRequest request)
The function that changes (or replaces) each request.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postProcessRequest(MockServerHttpRequest request) → MockServerHttpRequest
Returns the request to perform instead of request; usually request itself after changing its headers, cookies, attributes or principal.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited