responseToMap method

Map<String, dynamic> responseToMap([
  1. Response? response
])

Implementation

Map<String, dynamic> responseToMap([Response? response]) => {
      'data': (response ?? this.response)?.data,
      'statusCode': (response ?? this.response)?.statusCode,
      'statusMessage': (response ?? this.response)?.statusMessage,
      'extra': (response ?? this.response)?.extra,
      'headers': (response ?? this.response)?.headers,
      'isRedirect': (response ?? this.response)?.isRedirect,
      'realUri': (response ?? this.response)?.realUri.toString(),
      'redirects': (response ?? this.response)?.redirects.builder((item) => {
            'location': item.location,
            'statusCode': item.statusCode,
            'method': item.method,
          })
    };