Elegant HTTP networking in Swift
open sourceMITfree
Alamofire is an HTTP networking library for Swift that wraps URLSession in a compact, chainable API. It handles HTTP methods, parameter encoding, headers and authentication, downloads to a file and uploads, response validation and serialization (including Decodable), caching and redirect control, request adapting and automatic retry, certificate pinning and network reachability, and works with Swift concurrency and Combine. It runs on Apple's platforms (iOS, macOS, tvOS, watchOS and visionOS) as well as Linux, Windows and Android, and installs with Swift Package Manager, CocoaPods or Carthage. The Alamofire Software Foundation, a non-profit, maintains it alongside AFNetworking.
Problems it solves
- make HTTP requests from an iOS app with less boilerplate than URLSession
- retry failed network requests automatically in Swift
- decode JSON responses into Swift structs with request validation
- pin TLS certificates in my iOS app's network calls
- upload and download files with progress in Swift
Features
- chainable request API over URLSession
- parameter encoders, headers and authentication
- response validation and Decodable serialization
- request adapters and automatic retry
- certificate pinning and network reachability
- Swift concurrency and Combine support
- download to file and upload with progress
