{"id":1808,"url":"https://github.com/RxSwiftCommunity/RxAlamofire","last_synced_at":"2025-08-02T04:32:33.966Z","repository":{"id":36939900,"uuid":"41247272","full_name":"RxSwiftCommunity/RxAlamofire","owner":"RxSwiftCommunity","description":"RxSwift wrapper around the elegant HTTP networking in Swift Alamofire","archived":false,"fork":false,"pushed_at":"2024-04-04T15:16:06.000Z","size":3120,"stargazers_count":1629,"open_issues_count":21,"forks_count":247,"subscribers_count":40,"default_branch":"main","last_synced_at":"2025-07-29T07:29:46.575Z","etag":null,"topics":["alamofire","networking","rxswift"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RxSwiftCommunity.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-08-23T11:37:23.000Z","updated_at":"2025-06-30T20:30:06.000Z","dependencies_parsed_at":"2024-04-23T19:06:02.191Z","dependency_job_id":"1a85e11e-40f6-413b-85ca-10fdfea0d745","html_url":"https://github.com/RxSwiftCommunity/RxAlamofire","commit_stats":{"total_commits":242,"total_committers":45,"mean_commits":5.377777777777778,"dds":0.8347107438016529,"last_synced_commit":"b1bc0c45f743fe87a2a741430ac589de9736ab66"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/RxSwiftCommunity/RxAlamofire","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxAlamofire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxAlamofire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxAlamofire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxAlamofire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RxSwiftCommunity","download_url":"https://codeload.github.com/RxSwiftCommunity/RxAlamofire/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxAlamofire/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268071895,"owners_count":24191159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alamofire","networking","rxswift"],"created_at":"2024-01-05T20:15:56.299Z","updated_at":"2025-08-02T04:32:33.687Z","avatar_url":"https://github.com/RxSwiftCommunity.png","language":"Swift","funding_links":[],"categories":["Reactive Programming","Libraries","Network","Major"],"sub_categories":["Other free courses","Prototyping","Other Parsing","Concurrency"],"readme":"RxAlamofire\n===\n\nRxAlamofire is a [RxSwift](https://github.com/ReactiveX/RxSwift) wrapper around the elegant HTTP networking in Swift [Alamofire](https://github.com/Alamofire/Alamofire).\n\n![Create release](https://github.com/RxSwiftCommunity/RxAlamofire/workflows/Create%20release/badge.svg)\n[![Version](https://img.shields.io/cocoapods/v/RxAlamofire.svg?style=flat)](http://cocoapods.org/pods/RxAlamofire)\n[![License](https://img.shields.io/cocoapods/l/RxAlamofire.svg?style=flat)](http://cocoapods.org/pods/RxAlamofire)\n[![Platform](https://img.shields.io/cocoapods/p/RxAlamofire.svg?style=flat)](http://cocoapods.org/pods/RxAlamofire)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n## Getting Started\n\nWrapping RxSwift around Alamofire makes working with network requests a smoother and nicer task. Alamofire is a very powerful framework and RxSwift add the ability to compose responses in a simple and effective way.\n\nA basic usage is (considering a simple currency converter):\n\n```swift\nlet formatter = NSNumberFormatter()\nformatter.numberStyle = .currencyStyle\nformatter.currencyCode = \"USD\"\nif let fromValue = NSNumberFormatter().numberFromString(self.fromTextField.text!) {\n\nRxAlamofire.requestJSON(.get, sourceStringURL)\n                .debug()\n                .subscribe(onNext: { [weak self] (r, json) in\n                    if let dict = json as? [String: AnyObject] {\n                        let valDict = dict[\"rates\"] as! Dictionary\u003cString, AnyObject\u003e\n                        if let conversionRate = valDict[\"USD\"] as? Float {\n                            self?.toTextField.text = formatter\n                                .string(from: NSNumber(value: conversionRate * fromValue))\n                        }\n                    }\n                    }, onError: { [weak self] (error) in\n                        self?.displayError(error as NSError)\n                })\n                .disposed(by: disposeBag)\n\n} else {\n    self.toTextField.text = \"Invalid Input!\"\n}\n```\n\n## Example Usages\n\nCurrently, the library features the following extensions:\n\n```swift\nlet stringURL = \"\"\n\n// MARK: URLSession simple and fast\nlet session = URLSession.shared()\n\n_ = session.rx\n    .response(.get, stringURL)\n    .observeOn(MainScheduler.instance)\n    .subscribe { print($0) }\n\n_ = session.rx\n    .json(.get, stringURL)\n    .observeOn(MainScheduler.instance)\n    .subscribe { print($0) }\n\n_ = session.rx\n    .data(.get, stringURL)\n    .observeOn(MainScheduler.instance)\n    .subscribe { print($0) }\n\n// MARK: With Alamofire engine\n\n_ = json(.get, stringURL)\n    .observeOn(MainScheduler.instance)\n    .subscribe { print($0) }\n\n// validation\n_ = request(.get, stringURL)\n    .validate(statusCode: 200..\u003c300)\n    .validate(contentType: [\"application/json\"])\n    .responseJSON()\n    .observeOn(MainScheduler.instance)\n    .subscribe { print($0) }\n\n// progress\n_ = request(.get, stringURL)\n    .progress()\n    .observeOn(MainScheduler.instance)\n    .subscribe { print($0) }\n\n// just fire upload and display progress\n_ = upload(Data(), urlRequest: try! RxAlamofire.urlRequest(.get, stringURL))\n    .progress()\n    .observeOn(MainScheduler.instance)\n    .subscribe { print($0) }\n\n// progress and final result\n// uploading files with progress showing is processing intensive operation anyway, so\n// this doesn't add much overhead\n_ = request(.get, stringURL)\n    .flatMap { request -\u003e Observable\u003c(Data?, RxProgress)\u003e in\n        let dataPart = request.rx\n            .data()\n            .map { d -\u003e Data? in d }\n            .startWith(nil as Data?)\n        let progressPart = request.rx.progress()\n        return Observable.combineLatest(dataPart, progressPart) { ($0, $1) }\n    }\n    .observeOn(MainScheduler.instance)\n    .subscribe { print($0) }\n\n\n// MARK: Alamofire Session\n// same methods with any Alamofire Session\n\nlet session = Session.default\n\n// simple case\n_ = session.rx.json(.get, stringURL)\n    .observeOn(MainScheduler.instance)\n    .subscribe { print($0) }\n\n// URLHTTPResponse + JSON\n_ = session.rx.responseJSON(.get, stringURL)\n    .observeOn(MainScheduler.instance)\n    .subscribe { print($0) }\n\n// URLHTTPResponse + String\n_ = session.rx.responseString(.get, stringURL)\n    .observeOn(MainScheduler.instance)\n    .subscribe { print($0) }\n\n// URLHTTPResponse + Validation + JSON\n_ = session.rx.request(.get, stringURL)\n    .validate(statusCode: 200 ..\u003c 300)\n    .validate(contentType: [\"text/json\"])\n    .json()\n    .observeOn(MainScheduler.instance)\n    .subscribe { print($0) }\n\n// URLHTTPResponse + Validation + URLHTTPResponse + JSON\n_ = session.rx.request(.get, stringURL)\n    .validate(statusCode: 200 ..\u003c 300)\n    .validate(contentType: [\"text/json\"])\n    .responseJSON()\n    .observeOn(MainScheduler.instance)\n    .subscribe { print($0) }\n\n// URLHTTPResponse + Validation + URLHTTPResponse + String + Progress\n_ = session.rx.request(.get, stringURL)\n    .validate(statusCode: 200 ..\u003c 300)\n    .validate(contentType: [\"text/something\"])\n    .flatMap { request -\u003e Observable\u003c(String?, RxProgress)\u003e in\n        let stringPart = request.rx\n            .string()\n            .map { d -\u003e String? in d }\n            .startWith(nil as String?)\n        let progressPart = request.rx.progress()\n        return Observable.combineLatest(stringPart, progressPart) { ($0, $1) }\n    }\n    .observeOn(MainScheduler.instance)\n    .subscribe { print($0) }\n\n// Interceptor + URLHTTPResponse + Validation + JSON\nlet adapter = // Some RequestAdapter\nlet retrier = // Some RequestRetrier\nlet interceptor = Interceptor(adapter: adapter, retrier: retrier)\n_ = session.rx.request(.get, stringURL)\n    .validate()\n    .validate(contentType: [\"text/json\"])\n    .responseJSON()\n    .observeOn(MainScheduler.instance)\n    .subscribe { print($0) }\n```\n\n## Installation\n\nThere are three ways to install RxAlamofire\n\n### CocoaPods\n\nJust add to your project's `Podfile`:\n\n```\npod 'RxAlamofire'\n```\n\n### Carthage\n\nAdd following to `Cartfile`:\n\n```\ngithub \"RxSwiftCommunity/RxAlamofire\" ~\u003e 6.1\n```\n\n### Swift Package manager\n\nCreate a `Package.swift`  file\n\n```\n// swift-tools-version:5.0\n\nimport PackageDescription\n\nlet package = Package(\n        name: \"TestRxAlamofire\",\n\n        dependencies: [\n            .package(url: \"https://github.com/RxSwiftCommunity/RxAlamofire.git\",\n                     from: \"6.1.0\"),\n        ],\n\n        targets: [\n            .target(\n                    name: \"TestRxAlamofire\",\n                    dependencies: [\"RxAlamofire\"])\n        ]\n)\n\n```\n\n### Manually\n\nTo manual install this extension you should get the `RxAlamofire/Source/RxAlamofire.swift` imported into your project, alongside RxSwift and Alamofire.\n\n## Requirements\n\nRxAlamofire requires Swift 5.1 and dedicated versions of Alamofire (5.4.1) and RxSwift (6.0.0).\n\nFor the last RxSwift 5.1 support, please use RxAlamofire 5.7.1.\n\nFor the last Swift 5.0 support, please use RxAlamofire 5.1.0.\n\nFor the last Swift 4.2 support, please use RxAlamofire 4.5.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRxSwiftCommunity%2FRxAlamofire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRxSwiftCommunity%2FRxAlamofire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRxSwiftCommunity%2FRxAlamofire/lists"}