Alamofire /Alamofire

Elegant HTTP Networking in Swift

★ 42,397⑂ 7,644👁 1,050⑃ 1,182● 2,825▤ 108◈ 24
SwiftMITCreated 2014-07-31
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 create

Top issues

Discussions

Latest release

5.12.2 5.12.2 2026-09-10
Released 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.

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON