Skip to content

It is possible to decode all responses to UTF-8 using interceptResponse? #120

Open
@Greismorr

Description

@Greismorr

Currently, my interceptResponse looks like:

@override
  Future<ResponseData> interceptResponse({required ResponseData data}) async {
    if (kDebugMode) {
      print("-- RESPONSE --");
      print(data.body);
    }

    RequestExceptionCatcher.checkRequestResponse(
      data.statusCode,
    );

    data.body = utf8.decode(data.bodyBytes);

    return data;
  }

The problem is that the response body are not changing. Even when i manually set the body value to an empty string, the response.body outside of the intercepter is not changing.

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions