encodeJson method

Request encodeJson (
  1. Request request
)

Implementation

Request encodeJson(Request request) {
  var contentType = request.headers[contentTypeKey];
  if (contentType != null && contentType.contains(jsonHeaders)) {
    return request.replace(body: json.encode(request.body));
  }
  return request;
}