The markdown parsing is broken/disabled for release notes. Sorry about that, I'm chasing the source of a crash that's been bringing this website down for the last couple of days.
Data in data even if server responds with 0 bytes
3 years ago
Empty data as success
4 years ago
Allow the server to response with empty data
Disk request fixes, cancellation fixes, logging improvement
4 years ago
0.1.5: Bug fix
4 years ago
Fixed retain cycle on requests
0.1.4: Validation and custom error parsing
4 years ago
- add better validation of requests
- be able to specify a model type for error responses
(details in README)
- update internal urlRequest after going through all the RequestAdapters
- actually use the jsonDecoder passed in
- don't let Request retain the parent Network
Add RequestAdapter
4 years ago
New protocol for adding adapters (middleware) to a request:
```swift
public protocol RequestAdapter {
func adapt(_ urlRequest: URLRequest) -> URLRequest
}
```
`Request` now has `adapters: [RequestAdapter]` and `func withAdapter(_ adapter: RequestAdapter) -> Self` which you can use to chain the addition of adapters
Example:
```swift
network.request(OrderAPI.getOrders)
.withAdapter(AuthenticationAdapter(accessToken: accessToken))
.responseDecoded(of: OrderResponse.self)
```
Fixes DiskRequest and adds TargetType properties for mock data
4 years ago
TargetType protocol now includes:
```swift
var diskPath: String? { get } // for mocks using DiskRequest
var diskDelay: TimeInterval { get }
```
in order for a target to define a local json file for the request, and an optional delay (to test loading UI for example)
New Network API
4 years ago
This release introduces an almost complete rewrite of the API. See README for more info