{"id":1602,"url":"https://github.com/nghialv/Transporter","last_synced_at":"2025-08-02T04:32:25.945Z","repository":{"id":29379147,"uuid":"32914023","full_name":"nghialv/Transporter","owner":"nghialv","description":"A tiny library makes uploading and downloading easier","archived":false,"fork":false,"pushed_at":"2016-01-21T12:04:39.000Z","size":17733,"stargazers_count":451,"open_issues_count":7,"forks_count":43,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-07-29T22:57:55.512Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/nghialv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-26T07:42:59.000Z","updated_at":"2025-06-19T11:51:46.000Z","dependencies_parsed_at":"2022-08-31T23:50:32.363Z","dependency_job_id":null,"html_url":"https://github.com/nghialv/Transporter","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nghialv/Transporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nghialv%2FTransporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nghialv%2FTransporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nghialv%2FTransporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nghialv%2FTransporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nghialv","download_url":"https://codeload.github.com/nghialv/Transporter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nghialv%2FTransporter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268334617,"owners_count":24233793,"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-08-02T02:00:12.353Z","response_time":74,"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":[],"created_at":"2024-01-05T20:15:51.111Z","updated_at":"2025-08-02T04:32:24.194Z","avatar_url":"https://github.com/nghialv.png","language":"Swift","funding_links":[],"categories":["Networking","Libs"],"sub_categories":["Video","Other free courses","Network"],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg style=\"-webkit-user-select: none;\" src=\"https://dl.dropboxusercontent.com/u/8556646/transporter.png\" width=\"720\" height=\"225\"\u003e\n\u003c/p\u003e\n\n[![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat\n)](https://developer.apple.com/iphone/index.action)\n[![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat\n)](https://developer.apple.com/swift)\n[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat\n)](http://mit-license.org)\n[![Issues](https://img.shields.io/github/issues/nghialv/Transporter.svg?style=flat\n)](https://github.com/nghialv/Transporter/issues?state=open)\n\n\n\n\nFeatures\n-----\n\n- uploading/downloading multiple files concurrently or sequentially\n\t- grouping tasks with awesome custom operators (`|||` and `--\u003e`)\n- supports background uploading/downloading\n- supports progress tracking (single task and group of tasks)\n- enable to resume, pause, cancel, retry the task\n- header configurable\n- request parameters configurable\n\n\n**Quick example**\n\n``` swift\nlet path = NSBundle.mainBundle().pathForResource(\"bigfile\", ofType: \"zip\")\nlet fileUrl = NSURL(fileURLWithPath: path!)!\n\nlet task = UploadTask(url: \"http://server.com\", file: fileUrl)\n\t.progress { sent, total in\n\t\tlet per = Double(sent) / Double(total)\n\t\tprintln(\"uploading: \\(per)\")\n\t}\n\t.completed { response, json, error in\n\t\tprintln(\"completed\")\n\t}\n\n \n Transporter.add(task1 ||| task2 ||| task3)                     // concurrent tasks\n            .progress { bytes, total in\n                let per = Double(bytes) / Double(total)\n                println(\"concurrent tasks: \\(per)\")\n            }\n            .completed { alltasks in\n                println(\"task1, task2, task3: completed\")\n            }\n            .add(task4 --\u003e task5 --\u003e task6)                       // sequential tasks \n            .progress { bytes, total in\n                println(\"serial tasks\")\n            }\n            .resume()\n\n```\n\nUsage\n-----\n\n``` swift\n// downloading task\n\nlet task = DownloadTask(url: downloadUrl, destination: des)\n\t.progress { bytes, total in\n\t\tlet per = Double(bytes) / Double(total)\n\t\tprintln(\"downloading: \\(per)\")\n\t}\n\t.completed { response, _, error in\n\t\tprintln(\"completed\")\n\t}\n\n\n// uploading task\n// upload types: File, Data, Stream\n\nlet task = UploadTask(url: \"http://server.com\", data: uploadData)\n\t.progress { sent, total in\n\t\tlet per = Double(sent) / Double(total)\n\t\tprintln(\"uploading: \\(per)\")\n\t}\n\t.completed { response, json, error in\n\t\tprintln(\"completed\")\n\t}\n\n\n// using  `|||`  operator to create a group of concurrent tasks\n\nTransporter.add(task1 ||| task2 ||| task3)\n\n// using  `--\u003e`  operator to create a group of sequential tasks\n\nTransporter.add(task1 --\u003e task2 --\u003e task3)\n\n\n// task\n\ntask.headers = [\"key\": \"value\"]\ntask.params = [\"key\": \"value\"]\ntask.pause()\ntask.cancel()\ntask.retry\n\n// background handling\n// add the following method in the app delegate\n\nfunc application(application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: () -\u003e Void) {\n\tTransporter.handleEventsForBackgroundURLSection(identifier, completionHandler: completionHandler)\n}\n\n\n// Transporter configurations\n\nTransporter.headers = [key: value]\nTransporter.timeoutIntervalForRequest = 30.0\nTransporter.timeoutIntervalForResource = 24 * 60 * 60.0\nTransporter.HTTPMaximumconnectionsPerHost = 5\n\t\t\t\n```\n\n\nInstallation\n-----\n* Installation with CocoaPods\n\n```ruby\npod 'TransporterSwift', '0.1.1'\n```\n\nThen run the following command:\n\n```sh\npod install\n```\n\n* Copying all the files into your project\n* Using submodule\n\nTodo\n-----\n- [ ] retry, pause, cancel\n- [ ] validation\n\nRequirements\n-----\n- iOS 8.0+\n- Xcode 6.1\n\nLicense\n-----\n\nTransporter is released under the MIT license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnghialv%2FTransporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnghialv%2FTransporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnghialv%2FTransporter/lists"}