angel3_mock_request 10.0.0
angel3_mock_request: ^10.0.0 copied to clipboard
Manufacture dart:io HttpRequests, HttpResponses, HttpHeaders, etc.
Change Log #
10.0.0 #
The mocks now behave as dart:io's HttpRequest, HttpResponse and HttpHeaders do.
Breaking changes in 10.0.0 #
- Breaking:
MockHttpRequestextendsStream<Uint8List>, so its stream methods have the signatures ofdart:io'sHttpRequest - Breaking:
writethrowsArgumentErrorfor a character its encoding cannot represent, instead of truncating it
New in 10.0.0 #
MockHttpHeaders.tryParseContentLength
Fixes in 10.0.0 #
- Encoding:
writeand its relatives use the charset of thecontent-typeheader (or UTF-8, or the response'sencoding), chosen at the first write, instead of writing each UTF-16 code unit as a byte.write('')adds nothing,write(null)writesnull, andwritelnends lines with\n - Headers:
contentType,contentLength,chunkedTransferEncoding,date,expiresandifModifiedSinceare backed by their headers, withdart:io's defaults, parsing andnullhandling.content-lengthholds one validated value. A header is removed with its last value, apreserveHeaderCasename is stored lowercase, and locked headers also rejectpersistentConnection,hostandport - Content length:
MockHttpRequest.closesetscontent-lengthto the bytes written (unless set, empty or chunked); a response's length starts at-1, and the constructor'scontentLengthis optional - Streams: Errors come after the bytes added before them, no empty chunk is emitted on
closeorflush,add([])does nothing, andfirstWhere,lastWhereandsingleWherethrowStateErrorwhen nothing matches closeandaddStream:closemay be called more than once and returnsdone; duringaddStream, other writes throwStateError, andaddStreamcompletes with the source's first error- Responses:
MockHttpResponsekeeps thestatusCodeit is given, andbufferOutputtakes effect - Docs: The README tells how to install and use the package, and how to migrate from 9.x
9.2.0 #
- fix:
MockHttpHeaders.date,expiresandifModifiedSincenow returnnullwhen the header is absent, as indart:io, instead of the current time (which made every mock request look like a conditional request)
9.1.0 #
- Require Dart >= 3.13
9.0.0 #
- Require Dart >= 3.12
8.4.0 #
- Require Dart >= 3.8
- Updated
lintsto 6.0.0 - Updated dependencies to the latest release
8.3.0 #
- Require Dart >= 3.6
- Updated
lintsto 5.0.0 - Updated dependencies to the latest release
8.2.0 #
- Require Dart >= 3.3
- Updated
lintsto 4.0.0
8.1.1 #
- Updated repository link
8.1.0 #
- Updated
lintsto 3.0.0
8.0.0 #
- Require Dart >= 3.0
- Updated
httpto 1.0.0
7.0.1 #
- Fixed
BytesBuilderwarnings
7.0.0 #
- Require Dart >= 2.17
6.0.0 #
- Require Dart >= 2.16
5.0.0 #
- Skipped release
4.0.0 #
- Skipped release
3.0.0 #
- Skipped release
2.1.0 #
- Updated linter to
package:lints
2.0.2 #
- Updated README
- Updated test cases
2.0.1 #
- Updated README
2.0.0 #
- Migrated to work with Dart >= 2.12 NNBD
1.0.7 #
- Prepare for upcoming Dart SDK change where
HttpHeadersmethodsaddandsettake an additional optional parameterpreserveHeaderCase(thanks @domesticmouse!).
1.0.6 #
- Prepare for upcoming Dart SDK change whereby
HttpRequestimplementsStream<Uint8List>rather thanStream<List<int>>.
1.0.5 #
- Add
toStringtoMockHttpHeaders.
1.0.4 #
- Fix for
ifModifiedSince
1.0.3 #
- Dart2 fixes
- Apparently fix hangs that break Angel tests