Get 2.0
This release is a quick follow-up to Get 1.0 that fixes some of the shortcomings of the original Request
type design.
Request
can now be initialized with either a string (path: String
) or a URL (url: URL
)- Replace separate
.get(...)
,.post(...)
, and other factory methods with a singleHTTPMethod
type. Example:Request(path: "/user", method: .patch)
- The first parameter in the
Request
initializer is nowpath
orurl
, notmethod
that has a default value - Add a new
Request
initializer that defaults to theVoid
response type unless you specify it explicitly - Make
body
property ofRequest
writable - Add
upload(for:data:)
method - #50, thanks to @soemarko - Replace
APIDelegate
client(_:makeURLFor:query:)
method withclient(_:makeURLForRequest:)
so that you have complete access to theRequest
- Remove APIs deprecated in Get 1.0
See #51 for the reasoning behind the
Request
changes