🌀swift async http client - fast, lightweight, type-safe
.afterTask(TimeInterval, RetryTask, RetryTaskErrorCatcher?)
) to allow performing an async task before retrying the original request. With this new option is possible to perform work outside RealHTTP
and inject whatever you need into the original request.formURLEncodedBody()
function.HTTPAltRequestValidator
are now marked as open
to allow further customization of the validation behaviors.withTaskCancellationHandler()
method in HTTPDataLoader
in Swift 5.5. Also fixed the test_largeFileTestResume()
unit testmatch(URL:)
(with .ignoreQueryParameters
) HTTPStubber
function, which failed to match an URL when the port is explicitly set.responseTime
on HTTPStubResponse
to simulate different network conditionsExample:
let mock = try HTTPStubRequest()
.match(urlRegex: "(?s).*")
.stub(for: .get, {
$0.statusCode = .ok
$0.responseTime = .withSpeed(.speed1kbps) <--- SIMULATE A VERY SLOW NETWORK
$0.body = ...
$0.headers = [
...
]
})
HTTPMetrics
: Attempted to dereference garbage pointerHTTPDataLoader
crashes decrementStrong
(line 438)waitForStatusRecordUnlock
crash, thread lockRealHTTP built-in stubber will soon be removed from this package into a separate package. No changes at APIs level will be applied.