cyber_req library

A flexible Flutter/Dart API client for backends, featuring dynamic headers, secure bearer token management, multipart file uploads, configurable timeouts, and comprehensive callbacks for success, failure, and unauthorized handling.

Classes

ApiService
A flexible and robust API client for any backend.
MultipartFile
Represents a file to be uploaded in a multipart request.

Typedefs

FailureCallback = void Function(ApiException error, {int? statusCode})
Callback for failed API responses.
FinallyCallback = void Function()
Callback that is always executed after a request, regardless of success or failure.
SuccessCallback = void Function(Map<String, dynamic> data, {int? statusCode})
Callback for successful API responses.
UnauthorizedHandler = Future<void> Function()
Callback for handling 401 Unauthorized responses.

Exceptions / Errors

ApiException
UnauthorizedException