Optional.http constructor

Optional.http({
  1. required String url,
  2. required HttpMethod method,
  3. Map<String, Object>? headers,
  4. UserAgentDevice? userAgent,
  5. HttpResponseType? responseType,
  6. Object? payLoad,
  7. HttpPayload? payloadType,
  8. bool usePassedProxy = false,
  9. bool cacheResponse = false,
  10. ApplyMethod? apply,
  11. String? regex,
  12. int? regexGroup,
  13. String? regexReplace,
  14. String? regexReplaceWith,
  15. Map<String, String>? replaceFirst,
  16. Map<String, String>? replaceAll,
  17. int? cropStart,
  18. int? cropEnd,
  19. String? prepend,
  20. String? append,
  21. List<Object>? match,
  22. int? nth,
  23. String? splitBy,
  24. List<TransformationType>? transformationOrder,
})

Named constructor for HTTP-specific optional parameters

Implementation

factory Optional.http({
  required String url,
  required HttpMethod method,
  Map<String, Object>? headers,
  UserAgentDevice? userAgent,
  HttpResponseType? responseType,
  Object? payLoad,
  HttpPayload? payloadType,
  bool usePassedProxy = false,
  bool cacheResponse = false,
  // Optional common fields
  ApplyMethod? apply,
  String? regex,
  int? regexGroup,
  String? regexReplace,
  String? regexReplaceWith,
  Map<String, String>? replaceFirst,
  Map<String, String>? replaceAll,
  int? cropStart,
  int? cropEnd,
  String? prepend,
  String? append,
  List<Object>? match,
  int? nth,
  String? splitBy,
  List<TransformationType>? transformationOrder,
}) {
  return Optional._(
    url: url,
    method: method,
    headers: headers,
    userAgent: userAgent,
    responseType: responseType,
    payLoad: payLoad,
    payloadType: payloadType,
    usePassedProxy: usePassedProxy,
    cacheResponse: cacheResponse,
    apply: apply,
    regex: regex,
    regexGroup: regexGroup,
    regexReplace: regexReplace,
    regexReplaceWith: regexReplaceWith,
    replaceFirst: replaceFirst,
    replaceAll: replaceAll,
    cropStart: cropStart,
    cropEnd: cropEnd,
    prepend: prepend,
    append: append,
    match: match,
    nth: nth,
    splitBy: splitBy,
    transformationOrder: transformationOrder,
  );
}