toHttpRequest method

HttpRequest toHttpRequest()

Implementation

HttpRequest toHttpRequest() {
  return HttpRequest(
    baseUrl: baseUrl,
    path: uri.path,
    params: _jsonUtil.encodeRawJson(uri.parameters),
    method: method,
    server: uri.host,
    secure: uri.scheme == 'https',
    client: "Dio",
    requestHeader: _jsonUtil.encodeRawJson(headers),
    requestBody: data is FormData
        ? _jsonUtil.encodeRawJson(getFormData(data))
        : _jsonUtil.encodeRawJson(data),
    createdAt: DateTime.now().millisecondsSinceEpoch,
    requestSize: _byteUtil.stringToBytes(data.toString()),
    requestHashCode: hashCode,
  );
}