v1.4.0
What's New
- Improved Combine support (#34)
Request is now a Publisher. This lets you use Combine operators on your Request:
Request {
Url("https://jsonplaceholder.typicode.com/todos")
}
.map(\.data)
.decode([Todo].self, decoder: JSONDecoder())
.sink(receiveCompletion: { ... }, receiveValue: { ... })
There are also properties for objectPublisher, stringPublisher, and jsonPublisher. Using AnyRequest, that previous example could be rewritten as:
AnyRequest<[Todo]> {
Url("https://jsonplaceholder.typicode.com/todos")
}
.objectPublisher
.sink(receiveCompletion: { ... }, receiveValue: { ... })
buildEithersupport inRequestBuilder(#39)- Concatenate
Urls with+(#39) -Url("https://baseurl.com") + Url("/path") - Improved internals of Request (#42)
If you would like to add your own parameters to be used in a Request, you can simply implement the protocol: