iws_http 1.2.0
iws_http: ^1.2.0 copied to clipboard
Library to facilitate http requests with error handling for Rest API requests.
1.2.0 #
- Added optional
clientparameter toIwsHttp.setupandIwsHttp.newInstanceto supporthttp.Clientinjection andMockClienttesting. - Enabled persistent HTTP client connection pooling (HTTP Keep-Alive) and added
close()method. - Fixed runtime
TypeErrorwhen error responses are non-Map JSON payloads (arrays, strings, primitives). - Unified
uploadmethod with standard response and error processing (_getResponse), eliminating crashes on empty bodies or 204 responses. - Added optional
fieldNameandtimeoutparameters toupload. - Added optional
contentTypetoFileDtofor setting custom MIME types on multipart files. - Enhanced all
ApiExceptionsubclasses (BadRequestException,DataNotFoundException,FetchDataException,FormRequestException) to retain the original serverresponsepayload. - Implemented
toString()onApiExceptionfor cleaner error logging. - Normalized URL path joining between
basePathandpath, preventing missing or double slashes. - Added URL parameter encoding and trailing slash protection to
generatePath. - Added
defaultAuthconfiguration parameter and session helper methodsupdateBearerTokenandclearSession. - Caught
http.ClientExceptionandTlsExceptionin all request methods.
1.1.1 #
- Added timeout and connection error handling to the
uploadmethod. - Fixed exception logic to only throw
FetchDataExceptionfor malformed JSON when the HTTP status indicates success. - Added support for custom API messages on HTTP 429 responses.
1.1.0 #
- Updated to
http v1.6.0. - Added
defaultHeadersparameter to setup methods to include headers in all requests. - Added
apiKeyHeaderparameter to setup methods to customize the API key header name.
1.0.0 #
- Updated to
http v1.4.0. - Updated README with new usage examples.
- BREAKING: Removed deprecated
httpPost,httpPut,httpGet,httpDelete,httpUploadmethods.
0.8.2 #
- Fixed connection error message.
0.8.1 #
- Fixed upload method with apiKey.
0.8.0 #
- Added custom headers to requests.
0.7.1 #
- Fixed error message in file upload.
0.7.0 #
- Added fields to upload method.
0.6.1 #
- Fixed message error in responses with HTTP code 422.
0.6.0 #
- Updated to
http v1.2.1 - Fixed error in responses with HTTP code 204.
0.5.1 #
- Added error logs.
0.5.0 #
- Added PATCH method.
- Added timeout parameter.
0.4.1 #
- Fixed bug when decoding HTTP response.
0.4.0 #
- Added a non-singleton constructor.
0.3.0 #
- Added generatePath function to assist with path generation.
- Replaced the methods httpPost, httpPut, httpGet, httpDelete with post, put, get and delete.
0.2.0 #
- Added DataNotFoundException when server responds with 404 error.
- Added query parameters to httpUpload
0.1.0 #
- Removed required import iws_http/api_exception.dart.
0.0.1 #
- Initial release.