cloudflare library

Classes

BackgroundTransformer
The default Transformer for Dio.
BaseOptions
A set of base settings for each Dio(). BaseOptions and Options will be merged into one RequestOptions before sending the requests. See Options.compose.
Body
Use this annotation on a service method param when you want to directly control the request body of a POST/PUT request (instead of sending in as request parameters or form-style request body).
BodyExtra
Use this annotation on a service method param when you want to add individual fields to the request body without defining a complete DTO class. This is useful when you need to include additional fields in the request body alongside existing data, or when you only need to send a few specific fields without creating a full data transfer object.
CacheControl
CallAdapter<R, T>
Adapts a Call with return type R into the type of T. e.g. Future<User> to Future<Result<User>>
CancelRequest
Annotation for cancelling the request. When applied to a parameter, allows the method to accept a CancelToken that can be used to cancel the HTTP request.
CancelToken
Controls cancellation of Dio's requests.
Cloudflare
CloudflareErrorResponse
It is a wrapper for error responses from network calls
CloudflareHTTPResponse<BodyType>
It is a http.BaseResponse wrapper representing a response of a network call.
CloudflareImage
Documentation here: API docs: https://api.cloudflare.com/#cloudflare-images-properties Developer Cloudflare docs: https://developers.cloudflare.com/images/cloudflare-images
CloudflareImagesErrorCodes
CloudflareLiveInput
Documentation here: API docs: https://api.cloudflare.com/#stream-live-inputs-properties Developer Cloudflare docs: https://developers.cloudflare.com/stream/stream-live/
CloudflareResponse
Documentation here: API docs: https://api.cloudflare.com/#getting-started-responses
CloudflareStreamVideo
Documentation here: API docs: https://api.cloudflare.com/#stream-videos-properties Developer Cloudflare docs: https://developers.cloudflare.com/stream
CloudflareStreamVideosErrorCodes
DataTransmit<T>
DataUploadDraft
DataUploadDraft is the response object when requesting direct_upload For instance: https://api.cloudflare.com/#cloudflare-images-create-authenticated-direct-upload-url-v2
DELETE
Make a DELETE request
Dio
Dio enables you to make HTTP requests easily.
DioMixin
DioOptions
Annotation for passing Dio options to individual requests.
DioResponseType
Annotation to specify the response type for Dio requests.
ErrorInfo
ErrorInterceptorHandler
The handler for interceptors to handle error occurred during the request.
Extra
Extra data that will be passed to dio's request, response, transformer and interceptors.
Extras
Extra data that will be passed to dio's request, response, transformer and interceptors. Simple Example:
Field
Named pair for a form request.
FormData
A class to create readable "multipart/form-data" streams. It can be used to submit forms and file uploads to http server.
FormUrlEncoded
Denotes that the request body will use form URL encoding. Fields should be declared as parameters and annotated with Field.
FusedTransformer
A Transformer that has a fast path for decoding UTF8-encoded JSON. If the response is utf8-encoded JSON and no custom decoder is specified in the RequestOptions, this transformer is significantly faster than the default SyncTransformer and the BackgroundTransformer. This improvement is achieved by using a fused Utf8Decoder and JsonDecoder to decode the response, which is faster than decoding the utf8-encoded JSON in two separate steps, since Dart uses a special fast decoder for this case. See https://github.com/dart-lang/sdk/blob/5b2ea0c7a227d91c691d2ff8cbbeb5f7f86afdb9/sdk/lib/_internal/vm/lib/convert_patch.dart#L40
GET
Make a GET request
Make a HEAD request
Replaces the header with the value of its target.
Headers
The headers class for requests and responses.
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient.
HttpMethod
A holder that includes all http methods which are supported by retrofit.
HttpResponse<T>
Wrapper class that combines response data with the raw Dio response.
ImageAPI
ImageStats
ImageStats is the response object when requesting direct_upload For instance: https://api.cloudflare.com/#cloudflare-images-images-usage-statistics
Interceptor
Interceptor helps to deal with RequestOptions, Response, and DioException during the lifecycle of a request before it reaches users.
Interceptors
A Queue-Model list for Interceptors.
InterceptorsWrapper
A helper class to create interceptors in ease.
ListParam<T>
Indicates a param being used as queries or form data, and how does it gets formatted.
LiveInputOutput
LiveInputOutput is the response object of associated outputs to a live input
LiveInputRecording
Control recording the input to a Stream video. Behavior depends on the mode. In most cases, the video will initially be viewable as a live video and transition to on-demand after a condition is satisfied.
LogInterceptor
LogInterceptor is used to print logs during network requests. It should be the last interceptor added, otherwise modifications by following interceptors will not be logged. This is because the execution of interceptors is in the order of addition.
MediaNFT
Method
MultiPart
Denotes that the request body is multi-part. Parts should be declared as parameters and annotated with Part.
MultipartFile
An upload content that is a part of MultipartRequest. This doesn't need to correspond to a physical file.
NoBody
Use this annotation on a service method param when you want to indicate that no body should be generated for POST/PUT/DELETE requests.
OPTIONS
Make a OPTIONS request
Options
The configuration for a single request. BaseOptions and Options will be merged into one RequestOptions before sending the requests. See Options.compose.
Pagination
Documentation here: API docs: https://api.cloudflare.com/#getting-started-responses
ParseErrorLogger
Base class for logging errors that occur during parsing of response data.
Part
Denotes a single part of a multi-part request. Part parameters may not be null.
PartMap
Provides runtime metadata for a @Part annotation. Use this annotation to supply dynamic values like contentType or fileName that need to be determined at runtime rather than at compile time.
PATCH
Make a PATCH request
Path
Named replacement in a URL path segment.
POST
Make a POST request
PreventNullToAbsent
Prevents null values from being converted to absent values in generated code for body.
PUT
Make a PUT request
Queries
Query parameter keys and values appended to the URL.
Query
Query parameter appended to the URL.
QueuedInterceptor
Interceptor in queue.
QueuedInterceptorsWrapper
A helper class to create QueuedInterceptor in ease.
ReceiveProgress
Annotation for tracking download progress. When applied to a parameter, allows the method to accept a callback function that will be invoked with progress updates during data reception.
RedirectRecord
A record that records the redirection happens during requests, including status code, request method, and the location.
RequestInterceptorHandler
The handler for interceptors to handle before the request has been sent.
RequestOptions
The internal request option class that is the eventual result after BaseOptions and Options are composed.
ResponseBody
The response wrapper class for adapters.
ResponseInterceptorHandler
The handler for interceptors to handle after respond.
RestApi
Define an API.
RTMPS
SendProgress
Annotation for tracking upload progress. When applied to a parameter, allows the method to accept a callback function that will be invoked with progress updates during data transmission.
SRT
Support for SRT(Secure Reliable Transfer)
StreamAPI
SyncTransformer
If you want to custom the transformation of request/response data, you can provide a Transformer by your self, and replace the transformer by setting the Dio.transformer.
Transformer
Transformer allows changes to the request/response data before it is sent/received to/from the server.
TusAPI
TypedExtras
Extra data that will be passed to Dio's request, response, transformer, and interceptors. Extend TypedExtras and define fields that correspond to the keys passed into extras. The values of these fields will be derived from the data passed into your subclass.
UseCallAdapter
By annotating a method with @UseCallAdapter, you can specify a custom adapter class where you can adapt a call to another response wrapper
VideoPlaybackInfo
VideoSize
VideoStatus
Object specifying more fine-grained status for this video item. If "state" is "inprogress" or "error", "step" will be one of "encoding" or "manifest". When "state" is "inprogress", "pctComplete" will be a number between 0 and 100 indicating the approximate percent of that step that has been completed. If the "state" is "error", "errorReasonCode" and "errorReasonText" will contain additional details.
Watermark
Watermark profile

Enums

DioExceptionType
The exception enumeration indicates what type of exception has happened during requests.
FileAccessMode
The file access mode when downloading a file, corresponds to a subset of dart:io::FileMode.
ListFormat
Specifies the array format (a single parameter with multiple parameter or multiple parameters with the same name). and the separator for array items.
LiveInputRecordingMode
MediaProcessingState
Parser
Define how to parse response json If you want to support more, PR is welcome
ResponseType
Indicates which transformation should be applied to the response data.
ThumbnailFit
WatermarkPosition

Mixins

OptionsMixin
The mixin class for options that provides common attributes.

Functions

defaultDioExceptionReadableStringBuilder(DioException e) String
The default implementation of building a readable string of DioException.

Typedefs

CancelTokenCallback = CancelToken Function()
DefaultTransformer = SyncTransformer
DioError = DioException
DioError describes the exception info when a request failed.
DioErrorType = DioExceptionType
Deprecated in favor of DioExceptionType and will be removed in future major versions.
DioExceptionReadableStringBuilder = String Function(DioException e)
The readable string builder's signature of DioException.readableStringBuilder.
DioMediaType = MediaType
The type (alias) for specifying the content-type of the MultipartFile.
HeaderForEachCallback = void Function(String name, List<String> values)
The signature that iterates header fields.
InterceptorErrorCallback = void Function(DioException error, ErrorInterceptorHandler handler)
The signature of Interceptor.onError.
InterceptorSendCallback = void Function(RequestOptions options, RequestInterceptorHandler handler)
The signature of Interceptor.onRequest.
InterceptorSuccessCallback = void Function(Response response, ResponseInterceptorHandler handler)
The signature of Interceptor.onResponse.
JsonDecodeCallback = FutureOr Function(String)
The callback definition for decoding a JSON string.
JsonEncodeCallback = FutureOr<String> Function(Object)
The callback definition for encoding a JSON object.
ProgressCallback = void Function(int count, int total)
The type of a progress listening callback when sending or receiving data.
RequestEncoder = FutureOr<List<int>> Function(String request, RequestOptions options)
The type of a request encoding callback.
ResponseDecoder = FutureOr<String?> Function(List<int> responseBytes, RequestOptions options, ResponseBody responseBody)
The type of a response decoding callback.
TokenCallback = Future<String?> Function()
Callback for asynchronous token generation
ValidateStatus = bool Function(int? status)
The type of a response status code validate callback.

Exceptions / Errors

DioException
DioException describes the exception info when a request failed.
NotNullableError<T>
A TypeError thrown by _checkNotNullable.