generateCurlCommand method

String generateCurlCommand(
  1. RequestOptions options
)

Implementation

String generateCurlCommand(RequestOptions options) {
  var curl = 'curl -X ${options.method}';
  options.headers.forEach((k, v) {
    curl += ' -H "$k: $v"';
  });
  if (options.data != null) {
    curl += ' -d \'${jsonEncode(options.data)}\'';
  }
  curl += ' "${options.uri}"';
  return curl;
}