HttpLoggingInterceptor class

A RequestInterceptor and ResponseInterceptor implementation which logs HTTP request and response data.

Log levels can be set by applying level for more fine grained control over amount of information being logged.

Warning: Log messages written by this interceptor have the potential to leak sensitive information, such as Authorization headers and user data in response bodies. This interceptor should only be used in a controlled way or in a non-production environment.

Implemented types
Annotations
  • @immutable

Constructors

HttpLoggingInterceptor({Level level = Level.body})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
level Level
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
onRequest(Request request) FutureOr<Request>
override
onResponse(Response response) FutureOr<Response>
override
toString() String
A string representation of this object.
inherited

Operators

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