Jan 21, 2022
- Make
APIClientDelegate
method throwable - #16, thanks to Tomoya Hayakawa
Jan 10, 2022
- Add public
Request
intializer
Dec 29, 2021
- The new optional
send()
variant now also supportsString
, andData
.
Dec 29, 2021
- Add
send
variant that works with optional types. If the response is empty – returnnil
.
Dec 24, 2021
- Remove
value(for:)
. It's not a great convenience method if it requires the same amount of code as an regular version.
let user: User = try await client.send(.get("/user")).value
let user: User = try await client.value(for: .get("/user"))
Dec 23, 2021
- It now supports iOS 13, macOS 10, watchOS 6, and tvOS 13
- Make
willSend
async - #11, thanks to Lars-Jørgen Kristiansen - Add a more convenient way to initialize
APIClient
(same asImagePipeline
in Nuke):
let client = APIClient(host: "api.github.com") {
$0.delegate = MyClientDelegate()
$0.sessionConfiguration.httpAdditionalHeaders = ["apiKey": "easilyExtractableSecretKey"]
}
- You can now provide a session delegate (
URLSessionDelegate
) when instantiating a client for monitoring URLSession events – the client will continue doing its thing - Add metrics (
URLSessionTaskMetrics
) toResponse
- Add public
Response
initializer and make properties writable
Dec 13, 2021
- Method
send
now supports fetchingResponse<Data>
(returns raw data) andResponse<String>
(returns plain text) - Query parameters are now modeled as an array of
(String, String?)
tuples enabling "explode" support - You can now pass
headers
in the request - Body in
post
,put
, andpatch
can now be empty - All methods now support query parameters
- Add
body
parameter todelete
method - Make
body
parameter optional
Dec 10, 2021
- Make
Configuration
init public - #10, thanks to Theis Egeberg - All
send
methods now return a newResponse<T>
struct containing not just the response value, but also data, request, response, and status code. - Add
value(for:)
method that returnsT
– a replacement for the oldsend
method - Add
data(for:)
method returningResponse<Data>
- Add
options
,head
, andtrace
HTTP methods - Method
delete
to usequery
instead ofbody
Dec 8, 2021
- Add an option to customize the client's port and scheme - #7, thanks to Mathieu Barnachon
- Make values in query parameters optional - #8, thanks to Bernhard Loibl
- Update example JSON models to match the GitHub API spec - #5, thanks to Arthur Semenyutin
- Use
iso8601
date decoding and encoding strategies by default and add a way to customize the decoder and encoder - Add
id
to requests - Make
Request
properies public
Nov 28, 2021
- Make it available on more platforms
Nov 23, 2021
- Initial relase