HttpInterceptor class abstract

Abstract interceptor for HTTP requests and responses.

Override any hook you need; all default to passing through unchanged.

Each hook receives a typed data object and a handler. You MUST call exactly one of handler.next, handler.resolve, or handler.reject:

  • next: pass (possibly mutated) data to the next interceptor
  • resolve: short-circuit the chain with a synthetic response
  • reject: short-circuit the chain with an error

Each hook MUST call exactly one of handler.next, handler.resolve, or handler.reject. Failing to call any method will permanently stall the request pipeline.

Constructors

HttpInterceptor()
const

Properties

hashCode int
The hash code for this object.
no setterinherited
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
onError(Object error, StackTrace stackTrace, HttpErrorHandler handler) → void
onRequest(HttpRequestData request, HttpRequestHandler handler) → void
onResponse(HttpResponseData response, HttpResponseHandler handler) → void
toString() String
A string representation of this object.
inherited

Operators

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