42,397
stars
+0
7,644
forks
1,050
watchers
1,182
prs
2,825
issues
108
releases
24
discussions
README
!Alamofire: Elegant Networking in Swift
Alamofire is an HTTP networking library written in Swift.
- Features
- Component Libraries
- Requirements
- Migration Guides
- Communication
- Installation
- Contributing
- Usage
- Introduction - Making Requests, Response Handling, Response Validation, Response Caching
- HTTP - HTTP Methods, Parameters and Parameter Encoder, HTTP Headers, Authentication
- Large Data - Downloading Data to a File, Uploading Data to a Server
- Tools - Statistical Metrics, cURL Command Output
- 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.
swift
// 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 createTop issues
#2847Feature Request: Support URLSessionWebSocketTask9 comments · 2019-06-17#3488Enable Manual Response Caching7 comments · 2021-08-18#2527Download task file system permissions7 comments · 2018-05-22#3269Support for SPKI6 comments · 2020-08-04#3228Support custom packet size and delay in MultipartForm uploads5 comments · 2020-06-09#3552Swift Concurrency - Docs Unclear - Upload Request Progress4 comments · 2022-01-31#3360Network Error Logging Support4 comments · 2020-11-10#3021Path Encoding support4 comments · 2019-12-16
Discussions
#3962Forcing HTTP Requests over Cellular Even When Connected to Wi-Fi1 comments · 2025-06-06#3934Dynamic library clarity2 comments · 2025-02-10#3918Alamofire on IOS2 comments · 2024-11-08#3916Need a support for alamofire issues0 comments · 2024-10-31#3885Implementing 2FA with Authenticator0 comments · 2024-08-02#3875How to prevent interception with Alamofire without certificate pinning0 comments · 2024-06-02#3863How to best implement a request observer library, that won't clash with Alamofire?1 comments · 2024-04-15#3855Swift 5 SessionManager multipartFormDataEncodingMemoryThreshold0 comments · 2024-03-25
Latest release
5.12.2 5.12.2 2026-09-10Released on 2026-09-09. All issues associated with this milestone can be found using this filter. Added - Updated versioning. There are no functional changes in this release. - Added by Jon Shier in Pull Request 4054.