Skip to main content

iws_http 1.2.0 copy "iws_http: ^1.2.0" to clipboard
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 client parameter to IwsHttp.setup and IwsHttp.newInstance to support http.Client injection and MockClient testing.
  • Enabled persistent HTTP client connection pooling (HTTP Keep-Alive) and added close() method.
  • Fixed runtime TypeError when error responses are non-Map JSON payloads (arrays, strings, primitives).
  • Unified upload method with standard response and error processing (_getResponse), eliminating crashes on empty bodies or 204 responses.
  • Added optional fieldName and timeout parameters to upload.
  • Added optional contentType to FileDto for setting custom MIME types on multipart files.
  • Enhanced all ApiException subclasses (BadRequestException, DataNotFoundException, FetchDataException, FormRequestException) to retain the original server response payload.
  • Implemented toString() on ApiException for cleaner error logging.
  • Normalized URL path joining between basePath and path, preventing missing or double slashes.
  • Added URL parameter encoding and trailing slash protection to generatePath.
  • Added defaultAuth configuration parameter and session helper methods updateBearerToken and clearSession.
  • Caught http.ClientException and TlsException in all request methods.

1.1.1 #

  • Added timeout and connection error handling to the upload method.
  • Fixed exception logic to only throw FetchDataException for 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 defaultHeaders parameter to setup methods to include headers in all requests.
  • Added apiKeyHeader parameter 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, httpUpload methods.

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.
0
likes
160
points
147
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Library to facilitate http requests with error handling for Rest API requests.

Homepage

License

MIT (license)

Dependencies

flutter, http, http_parser

More

Packages that depend on iws_http