I'm happy to announce that Alamofire 5 has finally hit release candidate status and is now API stable. Our work now is to fix any bugs the community finds as we update our Advanced Usage documentation and write a (very long) migration guide.
RC 1 Release Notes
Sessionto cancel all in flight requests.
- Ability to inject
DataPreprocessorprotocol and implementations, allowing the preprocessing of data before serialization.
URLRequestvalidation and error.
GETrequests with body data will now produce an error.
DownloadResponse, making them
DataResponse<Success, Failure: Error>and
DownloadResponse<Success, Failure: Error>.
- Precondition to ensure
Sessioncan't be used with background
URLSessionConfigurations. Alamofire will explicitly support such functionality at some point in the future.
- SwiftFormat configuration and updated styling.
AFDownloadResponse<Success>typealiases to help deal with the doubly generic responses.
- All internal
Resultusage to use the fully qualified type instead of
DownloadRequestfunctional API, renaming
HTTPMethodto be a struct rather than an enum.
- All errors produced by Alamofire to be
AFErrorby default. All responses will now start with an
NetworkReachabilityManagerto simplify and modernize its API.
Usage.mddocumentation to be fully up-to-date with Alamofire 5.
- Bundle identifiers to include the platform name, fixing ITMS-90806.
The biggest change between beta 7 and RC 1 is that Alamofire's
*Response types are now doubly generic just like
Result. This means that transforming responses can preserve error types. This also enables us to use
AFError as the error type for all responses, and we've added the
AFDownloadResponse types to help with that transition. Simply replacing previous uses of the response types with their
AF counterparts should make this a seamless transition.
Please report any bugs you find to our GitHub, while any discussion of new APIs or feature requests should take place in this forum.