ResponseLogger class
The ResponseLogger is a default logger implementation for the responses. Here is how the logged response's structure looks like.
← RESPONSE ←
BODY:
Here is how real logged PUT request's response looks like in the console.
← RESPONSE ← PUT: https://example.com/api/v1/user/324234 CODE: 200 HEADERS: connection : keep-alive date : Thu, 04 May 2023 19:02:10 GMT transfer-encoding : chunked vary : accept-encoding content-encoding : gzip strict-transport-security : max-age=15724800; includeSubDomains content-type : application/json
BODY: {"message":"Success"}
The ResponseLogger is a descendant of Middleware, you can derive from the Middleware and create you own response logger.
- Inheritance
-
- Object
- Middleware<
RowResponse> - ResponseLogger
Constructors
-
ResponseLogger({Set<
LogParts> logParts = LogParts.all})
Properties
Methods
-
addNext(
Middleware< RowResponse> middleWare) → void -
This method adds a middleware to the chain.
This method is called by the Rest library, no need to call it manually,
instead use
RestClientBuilder.addRequestMiddleware
andRestClientBuilder.addResponseMiddleware
inherited -
next(
RowResponse row) → Future< RowResponse> -
This method will call next middleware in the chain. Initially this method get
called by the
RestClient
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onNext(
RowResponse row, Middleware< RowResponse> nextMiddleware) → Future<RowResponse> -
Override this method and implement your custom logic inside it.
After call await nextMiddleware.next(row) to run the next middleware in
the chain.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited