w_transport
Transport library for sending HTTP requests and opening WebSockets. Platform-independent with builtin support for browser and Dart VM (even supports SockJS). Includes mock utilities for testing.
5.4.4
31K downloads/mo
#1836 most downloaded on pub.dev
Workiva/w_transport
What this package is like to depend on
Last release 3 months ago
30 Apr 2026
Release timing varies
gaps range from 8 days to 8 months
Most releases are documented
notes for 53 of 69 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
69 releases · first in 2015
3 releases in the last 12 months
see the full history below
Release timeline
69 releases · May 2015 to Apr 2026Releases
latest 60 of 69-
5.4.430 Apr 2026Release notes
Open source →Info
Build: (waiting for build to complete)
Skynet Results: (waiting for Skynet results)
Pipeline: (waiting for pipeline to start)
This patch release includes the following changes:Miscellaneous
-
#456 Raise the mime dependency min to 1.0.0 and max to 3.0.0
-
#457 RM-383407 Release w_transport 5.4.4
- RM-383407 RELEASE w_transport 5.4.4
Notes created on Thursday, April 30 07:31 PM UTC
-
-
5.4.324 Feb 2026Release notes
Open source →Info
Build: (waiting for build to complete)
Skynet Results: (waiting for Skynet results)
Pipeline: (waiting for pipeline to start)
This patch release includes the following changes:Miscellaneous
-
#453 Update SDK range in example
-
#454 RM-382694 Release w_transport 5.4.3
- RM-382694 RELEASE w_transport 5.4.3
Notes created on Tuesday, February 24 07:38 PM UTC
Release notes
Open source →- Updated SDK ranges in the example package to keep it aligned with current tooling.
-
-
5.4.222 Feb 2026Release notes
Open source →Info
Build: (waiting for build to complete)
Skynet Results: (waiting for Skynet results)
Pipeline: (waiting for pipeline to start)
This patch release includes the following changes:Miscellaneous
-
#451 2_raise_build_deps_max_for_analyzer_10
-
#452 RM-351805 Release w_transport 5.4.2
- RM-351805 RELEASE w_transport 5.4.2
Notes created on Sunday, February 22 07:54 PM UTC
Release notes
Open source →- Raised build dependency ranges to support newer analyzer versions under Dart 3.
-
-
5.4.126 Aug 2025Release notes
Open source →Info
Build: (waiting for build to complete)
Skynet Results: (waiting for Skynet results)
Pipeline: (waiting for pipeline to start)
This patch release includes the following changes:Bug Fixes
- #449 FEA-8530: Fix late init error
- FEA-8530 Late init error in w_transport
Miscellaneous
- #450 RM-349935 Release w_transport 5.4.1
- RM-349935 RELEASE w_transport 5.4.1
Notes created on Tuesday, August 26 08:02 PM UTC
Release notes
Open source →- Removed possibility for a LateInitializationError when transforming a ProgressEvent stream from an HttpRequest into a RequestProgress stream.
- #449 FEA-8530: Fix late init error
-
5.4.018 Aug 2025Release notes
Open source →Info
Build: (waiting for build to complete)
Skynet Results: (waiting for Skynet results)
Pipeline: (waiting for pipeline to start)
This minor release includes the following changes:Miscellaneous
-
#445 Rollout React 18 to tests and example apps
-
#446 FEA-8447: Add
BinaryRequestfor sending requests and reading responses as ArrayBuffers in the browser- FEA-8447 Add
BinaryRequestfor sending requests and reading responses as ArrayBuffers in the browser
- FEA-8447 Add
-
#447 FEDX-3766: no_entrypoint_imports
- FEDX-3766 no_entrypoint_imports
-
#448 RM-343161 Release w_transport 5.4.0
- RM-343161 RELEASE w_transport 5.4.0
Notes created on Monday, August 18 05:29 PM UTC
Release notes
Open source →- Added
BinaryRequestfor sending raw bytes with proper browser support using theresponseTypefield on the XHR instance.
-
-
5.3.016 Jul 2025Release notes
Open source →Info
Build: (waiting for build to complete)
Skynet Results: (waiting for Skynet results)
Pipeline: (waiting for pipeline to start)
This minor release includes the following changes:Miscellaneous
-
#437 Prep for auto-publish
-
#438 Raise the uuid dependency max to v5.0.0
-
#439 Raise the uuid dependency min to v4.0.0
-
#443 FEA-8162: Support setting
Websocket.binaryType- FEA-8162 Support setting
Websocket.binaryType
- FEA-8162 Support setting
-
#444 RM-304477 Release w_transport 5.3.0
- RM-304477 RELEASE w_transport 5.3.0
Notes created on Wednesday, July 16 09:42 PM UTC
Release notes
Open source →- Added
WebSocket.binaryTypefield to allow configuring the binary type for WebSocket connections in the browser. Has no impact on the VM or when using SockJS.
-
-
5.2.317 Dec 2024Release notes
Open source →Info
Build: (waiting for build to complete)
Skynet Results: (waiting for Skynet results)
Pipeline: (waiting for pipeline to start)
This patch release includes the following changes:Miscellaneous
- #434 ESG-11074 Don't log bytes / body in the error message
- ESG-11074 w_transport: Don't log bytes / body in the error message
- #436 RM-302024 Release w_transport 5.2.3
- RM-302024 RELEASE w_transport 5.2.3
Notes created on Tuesday, December 17 08:32 PM UTC
- #434 ESG-11074 Don't log bytes / body in the error message
-
5.2.207 Dec 2024Release notes
Open source →Info
Build: (waiting for build to complete)
Skynet Results: (waiting for Skynet results)
Pipeline: (waiting for pipeline to start)
This patch release includes the following changes:Miscellaneous
-
#425 DSC-10121 - Complete transition to GHA
- DSC-10121 GHA - OpenSource - w_transport
-
#427 Replace mockito with mocktail
-
#428 Workiva Analysis Options v2
-
#429 Raise the build_web_compilers dependency max to v5.0.0
-
#430 Raise the meta dependency min to v1.16.0
-
#432 raise_min_dart_sdk_2_19
-
#433 RM-251053 Release w_transport 5.2.2
- RM-251053 RELEASE w_transport 5.2.2
Notes created on Saturday, December 07 12:24 AM UTC
-
-
5.2.129 Mar 2024Release notes
Open source →Info
Build: https://ci.webfilings.com/build/5728165
Skynet Results: https://wf-skynet-hrd.appspot.com/apps/test/smithy/5728165/latest
Pipeline: No Pipeline
This patch release includes the following changes:Miscellaneous
-
#421 FEA-3269: Fixed CI and addressed NNBD errors
- FEA-3269 Fixed CI and addressed NNBD errors
-
#422 Allow consumption of null-safe over_react and over_react_test versions
-
#423 Consume null-safe over_react v5 and over_react_test v3
-
#424 RM-222341 Release w_transport 5.2.1
- RM-222341 RELEASE w_transport 5.2.1
Notes created on Friday, March 29 11:13 PM UTC
-
-
5.2.003 Nov 2023Release notes
Open source →Info
Build: https://ci.webfilings.com/build/5155449
Skynet Results: https://wf-skynet-hrd.appspot.com/apps/test/smithy/5155449/latest
Pipeline: No Pipeline
This minor release includes the following changes:Miscellaneous
- #417 RM-222302 Release w_transport 5.2.0
- RM-222302 RELEASE w_transport 5.2.0
Notes created on Friday, November 03 08:51 PM UTC
Release notes
Open source →- Added
debugUrltoWebSocketConnectEventwhich is emitted via theGlobalWebSocketMonitor. When using SockJS, this will be populated with the full URL that the underlying transport is using, which can be useful information for debugging.
- #417 RM-222302 Release w_transport 5.2.0
-
5.1.031 Aug 2023Release notes
Open source →- Added
defaultTimeoutThresholdtop level field to add a timeout for all requests by default.
- Added
-
5.0.119 Aug 2023Release notes
Open source →- Made
RequestException.requestnullable and re-add the null check, as we found unsound consumer usages where this could be null. - Bumped
collectiondependency to a non-pre-release version.
- Made
-
5.0.018 Aug 2023Release notes
Open source →- Updated to null safety:
- Made as much of the public API non-nullable as safely possible.
- One notable behavioral change that was required in order to make the request
dispatch methods (like
.get()and.post()) return non-nullable: if any response interceptor takes a non-null response but returns a null response, the original non-null response will be used instead. In practice, we don't think this is common, and being able to make request methods return non-nullable was worth it.
- Updated to null safety:
-
4.1.626 Apr 2023Release notes
Open source →- Bug Fix: When using
MockTransports.install(fallThrough: true), the optionalbodyparam on thesend()method will now properly be applied when the request "falls through" the mock config to a real request. - Docs: Suggest using
.streamGet()over.get()for binary responses that will be read as bytes (viabody.asBytes()).
- Bug Fix: When using
-
4.1.508 Nov 2022Nothing published for this version
-
4.1.426 Oct 2022 -
4.1.310 Aug 2022Release notes
Open source →- Improvement JSON content will always decode as utf-8. Previously it would fall back to the encoding specified for the body, or to ISO-8859-1, which was the old fallback value. There is no longer any fallback value, per rfc7231, but it uses the media type value, which for JSON is by default UTF-8.
-
4.1.028 Jun 2022Release notes
Open source →- Improvement:
AutoRetryConfiggained theincreaseTimeoutOnRetryflag. This allows timeouts to increase as retry attempts increase.
- Improvement:
-
4.0.928 Jun 2022Nothing published for this version
-
4.0.827 Jun 2022 -
4.0.202 Mar 2022Release notes
Open source →- Bug Fix: The
bodyparameter given toRequest.send()was being ignored. It should now be used as expected.
- Bug Fix: The
-
4.0.116 Dec 2021Release notes
Open source →- Improvement: Implement equality for
RegExpto ensure 2 mock request handlers with the same pattern and regex settings are stored in a common map.
- Improvement: Implement equality for
-
4.0.002 Dec 2021Release notes
Open source →This is a major release with breaking changes.
Previously, this project included a
sockjs_clientdependency via a git reference, but in July of 2019 pub.dev began disallowing the publishing of packages with git dependencies. Additionally, this package included public APIs that depended on this git dependency. We are unable to get this dependency moved to pub.dev, so our only option is to release a major version and remove our usage of this dependency and any relevant APIs.We also had some pre-existing deprecations that we are removing in this major release.
With only a couple of exceptions, this 4.0.0 version should be backwards- compatible with 3.x.x as long as uses of deprecated APIs have been resolved.
Breaking Changes
- Breaking: Consumers of the SockJS implementation behind
WebSocketmust now includesockjs.json the page: - Breaking: Removed the following deprecated APIs:
- The
WSocketclass. UseWebSocketinstead. WSocketCloseEventWSocketException- The SockJS optional parameters (e.g.
useSockJSorsockJSProtocolsWhitelist) for:configureWTransportForBrowser()WebSocket.connect()
- The
Additional Changes
- Improvement: Be robust to empty contentType header on response.
- Improvement: The jitter approach used previously for exponential backoffs still leads to peaks in server load. This is now improved by adopting a more advanced backoff algorithm from Polly.
- Improvement: Added
closeCodeandcloseReasongetters toMockWebSocketServer. - Improvement: prep for a breaking change in Dart SDK to
HttpRequestandHttpClientResponse - Tech-debt: upgrade to
dart_devv3 - Tech-debt: use
workiva_analysis_optionsto simplify linter/analysis configuration. - Tech-debt: remove Dart 1 support
- Breaking: Consumers of the SockJS implementation behind
-
3.2.811 Oct 2018 -
3.2.710 Oct 2018 -
3.2.619 Jul 2018Release notes
Open source →July 19th, 2018
-
Bug Fix: When using
MockTransportswithfallThrough: true, requests that fall through now properly copy overcontentLengthandcontentTypeif applicable. -
Dependency: Upgraded minimum
sockjs_client_wrapperversion to 1.0.4 in order to pull in SockJS v1.1.5.
-
-
3.2.517 May 2018Release notes
Open source →May 17th, 2018
-
Bug Fix: The previous version introduced a new transformer for the w_transport examples, but did not properly scope it to the
examples/directory. This led to the following error during apub getfor some consumers:Precompiling dependencies... Loading source assets... Error on line 1, column 1 of https://pub.dartlang.org/api/packages/w_transport: Error loading transformer "over_react": package "over_react" is not a dependency.This has been fixed. If you're still seeing this error, run
pub upgrade w_transportto make sure you have the latest.
-
-
3.2.417 May 2018Release notes
Open source →May 16th, 2018
- Bug Fix: The browser implementation of
MultipartRequestwas previously adding every field to theFormDatatwice - this has been fixed.
- Bug Fix: The browser implementation of
-
3.2.326 Apr 2018Release notes
Open source →April 25th, 2018
- Improvement: Now compatible with Dart 2 and the Dart Dev Compiler.
-
3.2.220 Apr 2018 -
3.2.129 Jan 2018Release notes
Open source →January 29th, 2018
- Bug Fix: The
sockjs.jsdetection now usescontext.hasProperty()instead of actually trying to access theSockJSobject on the window. This fixes an exception that was being thrown silently in certain situations.
- Bug Fix: The
-
3.2.010 Jan 2018Release notes
Open source →January 4th, 2018
-
Improvement: Added support for the
sockjs_client_wrapperpackage. This will eventually replace our usage of thesockjs_clientDart port because the wrapper uses the actual JS library which is fully-featured and community supported.The SockJS wrapper requires that the JS library be included in the HTML page. To avoid a breaking change, it will only be used if the JS library is detected on the window.
If you are using the SockJS configuration for
WebSocketand wish to leverage this more fully-featured SockJS (which provides all of the SockJS protocols e.g.xhr-polling), all you need to do is add the JS script to your application page:https://github.com/workiva/sockjs_client_wrapper#usage
If you don't change anything, the SockJS configuration for
WebSocketwill still behave exactly the same and you should see no difference.
-
-
3.1.225 Sep 2017Nothing published for this version
-
3.1.124 Jul 2017Nothing published for this version
-
3.1.019 Jul 2017Nothing published for this version
-
3.0.612 Jul 2017Nothing published for this version
-
3.0.506 Jul 2017Nothing published for this version
-
3.0.404 Jul 2017Nothing published for this version
-
3.0.320 Mar 2017Release notes
Open source →March 15th, 2017
- Bug Fix: When a request is canceled, it will now always result in the
doneFuture resolving. Previously it was possible for thedoneFuture to never resolve if the request was canceled at a certain point during the request lifecycle.
- Bug Fix: When a request is canceled, it will now always result in the
-
3.0.206 Feb 2017Release notes
Open source →February 3rd, 2017
- Bug Fix: When
MockTransportsis installed with "fall-through" enabled, the optional SockJS params that are available on thenew transport.WebSocket()constructor are now properly passed through. Previously, a standard WebSocket implementation would have been constructed erroneously ifuseSockJS: truewas set, but it now correctly constructs the SockJS implementation.
- Bug Fix: When
-
3.0.119 Jan 2017Release notes
Open source →January 18th, 2017
- Bug Fix: If a request's
autoRetry.testfunction is supplied and returns true when theresponseis null, a request that was canceled would erroneously be retried. Canceling a request now properly makes it ineligible for retry regardless of other factors.
- Bug Fix: If a request's
-
3.0.025 Oct 2016Release notes
Open source →October 25th, 2016
This major release includes deprecations and an increased minimum Dart SDK version. This release should be backwards compatible with version 2.x.
To upgrade, check out the v3.0.0 upgrade guide.
Features
-
There is a new pattern for configuring
w_transportfor a particular platform. Check out the Transport Platform Configuration guide. -
There is a new way to install the transport mocks (instead of
configureWTransportForTest()). Check out the Mock Transports Installation guide.
Changes/Deprecations
-
Renamed entry points:
w_transport_browser.dart-->browser.dartw_transport_mock.dart-->mock.dartw_transport_vm.dart-->vm.dart
-
Other renames:
Client-->HttpClientWSocket-->WebSocketWSocketException-->WebSocketExceptionRetryBackOff.duration-->RetryBackOff.interval
-
Other deprecations:
WSocketCloseEventMockBaseRequestMockClientMockFormRequestMockJsonRequestMockPlainTextRequestMockResponseMockStreamedRequestMockStreamedResponseMockWSocket
Documentation
- The
w_transportdocumentation has been revamped with an emphasis on examples and guides. Check them out now!
-
-
2.10.124 Jul 2017Nothing published for this version
-
2.10.019 Jul 2017Nothing published for this version
-
2.9.930 Jun 2017Nothing published for this version
-
2.9.720 Mar 2017Nothing published for this version
-
2.9.609 Feb 2017Nothing published for this version
-
2.9.523 Jan 2017Nothing published for this version
-
2.9.420 Oct 2016Release notes
Open source →October 14, 2016
- Bug Fix: The
Futurereturned fromWSocket.cancel()no longer waits for the WebSocket to be closed.
- Bug Fix: The
-
2.9.308 Sep 2016Release notes
Open source →September 8, 2016
- Bug Fix: if a request is canceled right before it would also have exceeded
the timeout threshold, a
StateErrormay be thrown due to aCompleterbeing completed more than once. This is fixed now.
- Bug Fix: if a request is canceled right before it would also have exceeded
the timeout threshold, a
-
2.9.211 Aug 2016Release notes
Open source →August 11, 2016
- Widen the version range for the
http_parserdependency to speed up and/or fix downstream consumers experiencing version conflicts.
- Widen the version range for the
-
2.9.102 Aug 2016Release notes
Open source →August 2, 2016
- Bug Fix: previously, listening to a
WSocketinstance and then canceling the subscription before closing the socket would result in the "done" state never being reached. This is fixed now and theFuturereturned fromWSocket.doneandWSocket.close()will always resolve once the connection is closed.
- Bug Fix: previously, listening to a
-
2.9.026 Jul 2016Release notes
Open source →July 26, 2016
-
Improvement: All request classes now have a
bool isDonegetter that can be read to determine whether or not a request is complete (i.e. succeeded, failed, or canceled). -
Bug Fix: Calling
request.abort()more than once will no longer throw aStateError.
-
-
2.8.021 Jul 2016Release notes
Open source →July 21, 2016
-
Improvement: Mock transport handlers can now be canceled. This will allow consumers to remove HTTP or WebSocket mock handlers without having to call
MockTransports.reset()orMockTransports.uninstall.var uri = Uri.parse('/example'); var myHttpHandler = MockTransports.http.when(uri, (request) { ... }); myHttpHandler.cancel(); var myWebSocketHandler = MockTransports.webSocket.when(uri, handler: (protocols, headers) { ... }); myWebSocketHandler.cancel(); /// The same works for the `whenPattern()` methods, as well.
-
-
2.7.121 Jul 2016Release notes
Open source →July 20, 2016
-
Bug Fix: previously, you could not retry a request that failed with a
nullresponse. This is now allowed, but still has the same default behavior. To retry a request with anullresponse, use theautoRetry.testmethod accordingly:var request = new Request(); request.autoRetry ..enabled = true ..test = (request, response, willRetry) { if (response == null) return true; return willRetry; };
-
-
2.7.023 Jun 2016Release notes
Open source →June 23, 2016
-
Deprecation:
autoRetry.backOff.durationhas been deprecated in favor of the more aptly namedautoRetry.backOff.interval. -
Improvement: Automatic request retrying will now add jitter to the backoff intervals by default. To disable jitter, set
autoRetry.backOff.withJitter = false;. -
Improvement: You can now put a cap on the backoff interval used during automatic request retrying.
request.autoRetry.backOff.maxInterval = new Duration(minutes: 2); -
Bug Fix: A request's
encodingproperty can no longer be set to null. This would have most likely caused an RTE when the request was sent, so now anArgumentErrorwill be thrown immediately. -
Bug Fix: As of 2.6.0, if you were to set a request's content-type manually without a charset or with an unknown charset, it was possible to hit an RTE due to a null
encoding. TheHttpBodyclass has been updated to be more resilient to a missing encoding or charset. Additionally, all request classes will now pass in the value of itsencodingproperty, which should now always be non-null.
-
-
2.6.021 Jun 2016Release notes
Open source →June 20, 2016
-
Improvement: The
MockTransportutilities now support expecting and registering handlers for HTTP requests and WS connections that match aPatterninstead of exactly matching a URI. Handlers will also receive theMatchinstance.var response = new MockResponse.ok(); var webSocket = new MockWSocket(); var uriPattern = new RegExp('(http|ws)s:\/\/example.com\/(.*)'); // Capture any GET request to example.com/ MockTransports.http.expectPattern('GET', uriPattern, respondWith: response); // Register a handler for any GET request to https://example.com/ // The `Match` instance will be given to the handler, where it can be used // to read any of the captured groups. MockTransports.http.whenPattern(uriPattern, (request, match) async { print('path: ${match.group(2)}'); return response; }, method: 'GET'); // Capture any WS connection attempt to example.com/ MockTransports.webSocket.expectPattern(uriPattern, connectTo: webSocket); // Register a handler for an WS connection attempt to example.com/ // The `Match` instance will be given to the handler, where it can be used // to read any of the captured groups. MockTransports.webSocket.whenPattern(uriPattern, handler: (uri, {protocols, headers, match}) async { print('path: ${match.group(2)}'); return webSocket; }); -
Improvement: the content-type for HTTP requests can now be set manually.
var request = new Request() ..uri = Uri.parse('/example') ..contentType = new MediaType('application', 'x-custom', {'charset': UTF8.name});-
The content-type still has a default value based on the type of request (
Request- text/plain,JsonRequest- application/json, etc.). -
The content-type's charset parameter will still be updated automatically when you set the
encoding, but once you manually setcontentType, this behavior will stop. In other words, we are assuming that if you setcontentTypemanually, you are intentionally overriding the defaults and are taking responsibility of setting thecharsetparameter appropriately.
-
-
Bug Fix: the
StreamedRequestnow properly verifies that the request has not been sent when settingcontentType. It will now throw aStateErrorlike the rest of the request types.
-
-
2.5.116 Jun 2016Release notes
Open source →June 16, 2016
- Error Messaging: When a response body cannot be properly decoded/encoded
using the
Encodingdictated by thecontent-typeheader, aResponseFormatExceptionwill now be thrown with a much more descriptive message. The content-type, encoding, and body will be included.
- Error Messaging: When a response body cannot be properly decoded/encoded
using the
-
2.5.015 Jun 2016Release notes
Open source →June 15, 2016
-
Bug Fix:
WSocketextendsStreamandStreamSink, but was not fulfilling those contracts in all scenarios. In particular:-
After obtaining a
StreamSubscriptioninstance from a call toWSocket.listen(), reassigning theonData(),onError(), andonDone()handlers had no effect.var webSocket = await WSocket.connect(...); var subscription = webSocket.listen((data) { ... }); // This does nothing: subscription.onData((data) { ... }); // Same goes for onError() and onDone() -
A subscription to a
WSocketinstance did not properly respect pause and resume signals. This could produce a memory leak by buffering WebSocket events indefinitely. -
A
WSocketinstance was immediately listening to the underlying WebSocket and buffering events from the underlying WebSocket until a listener was registered. This is not how a standard DartStreamworks. -
The SockJS configuration was not properly handling the fact that the SockJS
Clientproduces WebSocket events with a broadcast stream. -
All of these issues have been addressed, and every
WSocketinstance should now behave exactly as a standardStreamandStreamSinkwould, regardless of the platform (VM, browser, SockJS, or mock).
-
The
WSocketCloseEventclass has been deprecated. This class was only used internally and should not have been exported as a part of the public API.The WSocket implementations are no longer registering an
onErrorhandler for the underlying WebSocket stream. If an error occurs on the server, it will not add the error to the stream, it will just close the connection. As a result, theMockWSocket.triggerServerError()method has been deprecated - useMockWSocket.triggerServerClose()instead. -
-
2.4.004 May 2016Release notes
Open source →May 4, 2016
-
Improvement:
FormRequestnow supports fields with multiple values.var request = new FormRequest() ..fields['multi'] = ['one', 'two']; -
SDK Compatibility: Dart 1.16 exposed a new
Clientclass from thedart:htmllibrary that conflicted with theClientclass in this library. This has been fixed by adjusting our imports internally, but it may still affect consumers of this library. -
Documentation: fixed inaccurate documentation around mocking & testing with WebSockets.
-