newRequestOptions function

RequestOptions newRequestOptions(
  1. Options options
)

Implementation

RequestOptions newRequestOptions(Options options) {
  if (options is RequestOptions) {
    return options;
  }
  if (options == null) {
    return RequestOptions();
  }
  return RequestOptions(
    method: options.method,
    sendTimeout: options.sendTimeout,
    receiveTimeout: options.receiveTimeout,
    extra: options.extra,
    headers: options.headers,
    responseType: options.responseType,
    contentType: options.contentType.toString(),
    validateStatus: options.validateStatus,
    receiveDataWhenStatusError: options.receiveDataWhenStatusError,
    followRedirects: options.followRedirects,
    maxRedirects: options.maxRedirects,
    requestEncoder: options.requestEncoder,
    responseDecoder: options.responseDecoder,
  );
}