{"id":21899358,"url":"https://github.com/satishbabariya/resty","last_synced_at":"2025-04-15T19:03:10.760Z","repository":{"id":62452845,"uuid":"189820580","full_name":"satishbabariya/resty","owner":"satishbabariya","description":"Simple HTTP Networking Library with Async/Await and Codable.","archived":false,"fork":false,"pushed_at":"2022-01-15T20:13:44.000Z","size":20,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T23:51:15.645Z","etag":null,"topics":["async","await","cocoapods","ios","linux","macos","network","networking","requests","responce","resty","swift","swift-package-manager","urlrequest","urlsession"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":false,"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/satishbabariya.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-06-02T08:08:13.000Z","updated_at":"2021-12-18T15:58:36.000Z","dependencies_parsed_at":"2022-11-01T23:46:43.578Z","dependency_job_id":null,"html_url":"https://github.com/satishbabariya/resty","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satishbabariya%2Fresty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satishbabariya%2Fresty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satishbabariya%2Fresty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satishbabariya%2Fresty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/satishbabariya","download_url":"https://codeload.github.com/satishbabariya/resty/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249135822,"owners_count":21218365,"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","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":["async","await","cocoapods","ios","linux","macos","network","networking","requests","responce","resty","swift","swift-package-manager","urlrequest","urlsession"],"created_at":"2024-11-28T14:42:07.434Z","updated_at":"2025-04-15T19:03:10.677Z","avatar_url":"https://github.com/satishbabariya.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# resty\nSimple HTTP Networking Library with Async/Await and Codable.\n\n```swift\nlet todos: [Todo] = try await FakeAPI.todos.request()\n```\n\n[![Language: Swift 5](https://img.shields.io/badge/language-Swift%205-f48041.svg?style=flat-square)](https://developer.apple.com/swift)\n[![Version](https://img.shields.io/cocoapods/v/Resty.svg?style=flat-square)](http://cocoapods.org/pods/Resty)\n[![License](https://img.shields.io/cocoapods/l/Resty.svg?style=flat-square)](http://cocoapods.org/pods/Resty)\n[![Platform](https://img.shields.io/badge/platforms-iOS%209.0+%20%7C%20macOS%2010.12+%20%7C%20watchOS%203.0+-333333.svg?style=flat-square)](http://cocoapods.org/pods/SwiftyContacts)\n[![Swift Package Manager](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg?style=flat-square)](https://github.com/apple/swift-package-manager)\n\n\n- [Installation](#installation)\n- [Get started](#get-started)\n- [License](#license)\n\n\n\n## Installation\n\n### CocoaPods\n\nTo integrate Resty into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\npod 'Resty'\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n### Swift Package Manager\n\nTo use SwiftyContacts as a [Swift Package Manager](https://swift.org/package-manager/) package just add the following in your Package.swift file.\n\n``` swift\ndependencies: [\n    .package(url: \"https://github.com/satishbabariya/Resty.git\", .upToNextMajor(from: \"1.0.0\"))\n]\n```\n\n## Get started\n\nImport SwiftyContacts into your porject\n\n```swift\nimport Resty\n```\n\n### Request with codable async/await\n\n```swift\nlet todos: [Todo] = try await FakeAPI.todos.request()\n```\n\n### Request with codable\n\n```swift\n\nFakeAPI.todos.request(type: [Todo].self) { result in\n     switch result {\n        case let .success(todos):\n                // Array of [Todo]                \n        case let .failure(error):\n                // error                \n     }     \n}\n\n```\n\n### REST API Setup\n\n```swift\nstruct Todo: Codable {\n    let id: Int\n    let title: String\n    let completed: Bool\n}\n\nenum FakeAPI: Resty {\n    case todos\n}\n\nextension FakeAPI {\n    var host: String {\n        return \"https://jsonplaceholder.typicode.com/\"\n    }\n\n    var path: String {\n        return \"\"\n    }\n\n    var endpoint: String {\n        switch self {\n        case .todos:\n            return \"todos\"\n        }\n    }\n\n    var method: HTTPMethod {\n        switch self {\n        case .todos:\n            return .get\n        }\n    }\n\n    var parameters: [String: Any]? {\n        return nil\n    }\n\n    var headers: [String: String]? {\n        return nil\n    }\n}\n```\n\n## Author\n\nSatish Babariya, satish.babariya@gmail.com\n\n## License\n\nResty is available under the MIT license. See the LICENSE file for more info.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsatishbabariya%2Fresty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsatishbabariya%2Fresty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsatishbabariya%2Fresty/lists"}