isJsonResponse static method

bool isJsonResponse(
  1. Response response
)

Returns true if the Response or DioError contains a JSON response.

Implementation

static bool isJsonResponse(Response<dynamic> response) =>
    response.headers[Headers.contentTypeHeader]![0] ==
    ContentTypeLiterals.APPLICATION_JSON;