buildRequestBodyStr method

String buildRequestBodyStr(
  1. RequestOptions options
)

Implementation

String buildRequestBodyStr(RequestOptions options) {
  String? contentType = contentType2(options.headers);
  if(isStr(contentType)){
    dynamic data =  options.data;
    // debugPrint("response : "+ data.toString());
    if (data == null){
      return "body null";
    }
    if(data is Map){
      return data.toString();
    }
    return data.toString();
  }
  options.headers["content-type-real"] = contentType.toString();
  options.headers["content-type"] = ["text/plain"];
  return "request body not text-> "+contentType.toString();
}