Alamofire
Elegant HTTP Networking in Swift
Install / Use
/learn @Alamofire/AlamofireREADME

Alamofire is an HTTP networking library written in Swift.
- Features
- Component Libraries
- Requirements
- Migration Guides
- Communication
- Installation
- Contributing
- Usage
- Advanced Usage
- URL Session - Session Manager, Session Delegate, Request
- Routing - Routing Requests, Adapting and Retrying Requests
- Model Objects - Custom Response Handlers
- Advanced Concurrency - Swift Concurrency and Combine
- Connection - Security, Network Reachability
- Open Radars
- FAQ
- Credits
- Donations
- License
Features
- [x] Chainable Request / Response Methods
- [x] Swift Concurrency Support Back to iOS 13, macOS 10.15, tvOS 13, and watchOS 6.
- [x] Combine Support
- [x] URL / JSON Parameter Encoding
- [x] Upload File / Data / Stream / MultipartFormData
- [x] Download File using Request or Resume Data
- [x] Authentication with
URLCredential - [x] HTTP Response Validation
- [x] Upload and Download Progress Closures with Progress
- [x] cURL Command Output
- [x] Dynamically Adapt and Retry Requests
- [x] TLS Certificate and Public Key Pinning
- [x] Network Reachability
- [x] Comprehensive Unit and Integration Test Coverage
- [x] Complete Documentation
Write Requests Fast!
Alamofire's compact syntax and extensive feature set allow requests with powerful features like automatic retry to be written in just a few lines of code.
// Automatic String to URL conversion, Swift concurrency support, and automatic retry.
let response = await AF.request("https://httpbin.org/get", interceptor: .retryPolicy)
// Automatic HTTP Basic Auth.
.authenticate(username: "user", password: "pass")
// Caching customization.
.cacheResponse(using: .cache)
// Redirect customization.
.redirect(using: .follow)
// Validate response code and Content-Type.
.validate()
// Produce a cURL command for the request.
.cURLDescription { description in
print(description)
}
// Automatic Decodable support with background parsing.
.serializingDecodable(DecodableType.self)
// Await the full response with metrics and a parsed body.
.response
// Detailed response description for easy debugging.
debugPrint(response)
Component Libraries
In order to keep Alamofire focused specifically on core networking implementations, additional component libraries have been created by the Alamofire Software Foundation to bring additional functionality to the Alamofire ecosystem.
- AlamofireImage - An image library including image response serializers,
UIImageandUIImageViewextensions, custom image filters, an auto-purging in-memory cache, and a priority-based image downloading system. - AlamofireNetworkActivityIndicator - Controls the visibility of the network activity indicator on iOS using Alamofire. It contains configurable delay timers to help mitigate flicker and can support
URLSessioninstances not managed by Alamofire.
Requirements
| Platform | Minimum Swift Version | Installation | Status | | ---------------------------------------------------- | --------------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------ | | iOS 10.0+ / macOS 10.12+ / tvOS 10.0+ / watchOS 3.0+ | 6.0 / Xcode 16.0 | CocoaPods, Carthage, Swift Package Manager, Manual | Fully Tested | | Linux | Latest Only | Swift Package Manager | Building But Unsupported | | Windows | Latest Only | Swift Package Manager | Building But Unsupported | | Android | Latest Only | Swift Package Manager | Building But Unsupported |
Known Issues on Linux and Windows
Alamofire builds on Linux, Windows, and Android but there are missing features and many issues in the underlying swift-corelibs-foundation that prevent full functionality and may cause crashes. These include:
ServerTrustManagerand associated certificate functionality is unavailable, so there is no certificate pinning and no client certificate support.- Various methods of HTTP authentication may crash, including HTTP Basic and HTTP Digest. Crashes may occur if responses contain server challenges.
- Cache control through
CachedResponseHandlerand associated APIs is unavailable, as the underlying delegate methods aren't called. URLSessionTaskMetricsare never gathered.WebSocketRequestis not available.
Due to these issues, Alamofire is unsupported on Linux, Windows, and Android. Please report any crashes to the Swift bug reporter.
Migration Guides
Related Skills
node-connect
329.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
81.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
329.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
81.1kCommit, push, and open a PR
