convertRequest method

  1. @override
Request convertRequest (
  1. Request request
)
override

Implementation

@override
Request convertRequest(Request request) {
  var req = applyHeader(
    request,
    contentTypeKey,
    formEncodedHeaders,
    override: false,
  );

  if (req.body is Map<String, String>) return req;

  if (req.body is Map) {
    final body = <String, String>{};

    req.body.forEach((key, val) {
      if (val != null) {
        body[key.toString()] = val.toString();
      }
    });

    req = req.replace(body: body);
  }

  return req;
}