{"id":30508934,"url":"https://github.com/afsaredrisy/mrestclient","last_synced_at":"2025-08-25T23:20:38.980Z","repository":{"id":62447072,"uuid":"239000175","full_name":"afsaredrisy/MRestClient","owner":"afsaredrisy","description":null,"archived":false,"fork":false,"pushed_at":"2020-02-22T12:07:02.000Z","size":176,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-16T16:46:05.074Z","etag":null,"topics":["alamofire","codable","http-client","mrest-client","rest-api","swift-restful"],"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/afsaredrisy.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":"2020-02-07T18:47:45.000Z","updated_at":"2020-02-22T12:07:04.000Z","dependencies_parsed_at":"2022-11-01T23:06:07.456Z","dependency_job_id":null,"html_url":"https://github.com/afsaredrisy/MRestClient","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/afsaredrisy/MRestClient","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afsaredrisy%2FMRestClient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afsaredrisy%2FMRestClient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afsaredrisy%2FMRestClient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afsaredrisy%2FMRestClient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afsaredrisy","download_url":"https://codeload.github.com/afsaredrisy/MRestClient/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afsaredrisy%2FMRestClient/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272144974,"owners_count":24881220,"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-25T02:00:12.092Z","response_time":1107,"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","codable","http-client","mrest-client","rest-api","swift-restful"],"created_at":"2025-08-25T23:20:31.705Z","updated_at":"2025-08-25T23:20:38.975Z","avatar_url":"https://github.com/afsaredrisy.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MRestClient\n\n[![CI Status](https://img.shields.io/badge/Pod-1.7.5-yellowgreen)](https://travis-ci.org/afsaredrisy/MRestClient)\n[![Version](https://img.shields.io/badge/Version-0.1.0-lightgrey)](https://cocoapods.org/pods/MRestClient)\n[![License](https://img.shields.io/badge/License-MIT-blue)](https://cocoapods.org/pods/MRestClient)\n[![Platform](https://img.shields.io/badge/Platform-Swift%205.0-green)](https://cocoapods.org/pods/MRestClient)\n\n![image](mrestclientlogo.png)\n\n## Example\n\nMRestClient is the HTTP client implementation library written in swift, It is small , light weight \u0026 simple to use library for HTTP communication .The goal of this library is to reduce the effort to call REST-API with swift codable object. This is the generic implementation of swift object for request \u0026 response body so you can directly interact with codable object without worrying JSON conversion etc. \n\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Requirements\n- [x] Xcode 11.\n- [x] Swift 5.\n- [x] iOS 11 or higher.\n\n## Installation\n\nMRestClient is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'MRestClient'\n```\n\n## Usage\n\nHTTP methos **GET** , **POST**, **PUT**  \u0026 **DELETE** are available to use, Following are the example of use case.\n\nWe will use following codable classes for request and response, \n[These-Demo](http://dummy.restapiexample.com) APIs we are using for demonostration. \n\n```swift \nclass Employee: Codable{\n    var profile_image: String\n    var employee_name: String\n    var employee_salary: String\n    var id: String\n    var employee_age: String\n}\n\nclass Employees: Codable {\n    var data: [Employee]\n    var status: String\n    init(data: [Employee], status: String) {\n        self.data = data\n        self.status = status\n    }\n}\n\n```\n**GET**\nURL = http://dummy.restapiexample.com/api/v1/employees \u003cbr/\u003e\nResponse JSON = Object of Empoyees\n\n```swift\n        let base_url = \"http://dummy.restapiexample.com\"\n        let  uri = \"/api/v1/employees\"\n        let rest_client = MRestClient\u003cNone, Employees\u003e(base_url: base_url)\n        rest_client.get(uri: uri, sucess: {(data, response) in\n          \n          // Do stuff on Success data is object of Empoyees class\n           \n       }, fail: {(error) in\n           // Fail callback\n       })\n\n```\n**POST**\n\nSample API description can found [here](http://dummy.restapiexample.com/create)\n\n```swift\n      let uri = \"/api/v1/create\"\n      // First Generic is the type of object used in request body second used for Response body\n      let rest_Client = MRestClient\u003cEmpDTO, EmployeeWithStatus\u003e(base_url: base_url)\n      rest_Client.post(url: uri, requestData: new_employee, sucess: {(data, response)in\n        \n        // Do Stuff on sucess data is object of EmployeeWithStatus\n        \n      }, fail: {(error) in\n          \n          //Request has fail see error\n          \n      })\n\n```\nFor **PUT** \u0026 **DELETE** [See](https://github.com/afsaredrisy/MRestClient/tree/master/Example) demo application \n\n## Contributions\nIf you want to improve the Demo or contribute in some way, please do so by creating a pull request. We welcome contributions.\n\n## License\n\nMRestClient is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafsaredrisy%2Fmrestclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafsaredrisy%2Fmrestclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafsaredrisy%2Fmrestclient/lists"}