simple_https_service 2.0.0
simple_https_service: ^2.0.0 copied to clipboard
A package for simple HTTPS communication with timing control and response handling.
2.0.0 - 2026-05-15 #
- Added
CancelToken: a caller-driven cancellation token that can be shared across multiple in-flight requests. Callingcancel()aborts every request currently using the token by closing the underlyinghttp.Client, and also interrupts any pending TimingManager wait or exponential-backoff delay. (HowClient.close()aborts the in-flight request is delegated to thehttppackage and the platform; this package does not depend on any particular underlying transport.) - Added
EnumServerResponseStatus.cancelledandUtilServerResponse.cancelled()so cancelled requests can be distinguished from real failures in UI / error reporting paths. - All POST methods on
HttpsServiceandHttpsServiceForNative(post,customPost,postBytes,postMultipart) now accept an optionalcancelTokenparameter. - BREAKING:
EnumServerResponseStatusgained a new value (cancelled). Any exhaustiveswitchon the enum will need an additional case. - Internal:
HttpsServiceno longer uses thehttp.post()/http.send()static helpers and instead manages anhttp.Clientper attempt so it can be closed to abort an in-flight request. No behavior change for callers that do not use cancellation.
1.1.0 - 2026-05-15 #
- Added
postBytesfor sending raw binary payloads with a custom Content-Type (defaults toapplication/octet-stream). - Added
postMultipartfor sendingmultipart/form-datawith text fields and binary files. Only byte input is supported via the newMultipartFileSpecclass to keep retries safe and the API simple. MultipartFileSpecsupports an optionalcontentType(e.g."image/png") so each part can carry its own MIME type. When omitted, the multipart defaultapplication/octet-streamis used.- Both new methods are available on
HttpsServiceandHttpsServiceForNativeand share the same timing/retry/response handling aspost/customPost. - Added
http_parser(already a transitive dependency ofhttp) to dependencies so per-partcontentTypestrings can be parsed viaMediaType.parse. - Internal: extracted the retry + timing + response formatting loop into a
private helper (
lib/src/network/post_runner.dart) to remove duplication betweenHttpsServiceandHttpsServiceForNative. No behavior change for existing methods.
1.0.0 - 2026-05-02 #
- Initial release.
HttpsService: HTTPS POST for web and native platforms.HttpsServiceForNative: HTTPS POST for native platforms with self-signed certificate support.TimingManager: Singleton for controlling request intervals.RetryConfig: Singleton for configuring automatic retry with exponential backoff and jitter.ServerResponse: Unified response object with categorized status.EnumServerResponseStatus: Response status enum (success, timeout, serverError, otherError, signInRequired).EnumServerResponseType: Response body format enum (json, byte, text).EnumPostEncodeType: POST encoding type enum (urlEncoded, json).UtilCheckURL: Utility for HTTPS URL validation.UtilServerResponse: Factory utility for creatingServerResponseobjects.