{"id":21437598,"url":"https://github.com/gabrieltheodoropoulos/gtrest","last_synced_at":"2026-01-04T11:02:38.101Z","repository":{"id":56912453,"uuid":"181846932","full_name":"gabrieltheodoropoulos/GTRest","owner":"gabrieltheodoropoulos","description":"A lightweight Swift library for making web requests and consuming RESTful APIs!","archived":false,"fork":false,"pushed_at":"2019-04-17T09:33:24.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T00:04:48.942Z","etag":null,"topics":["ios","rest","restful-webservices","swift","web-services"],"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/gabrieltheodoropoulos.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":"2019-04-17T08:14:27.000Z","updated_at":"2023-06-20T19:11:05.000Z","dependencies_parsed_at":"2022-08-21T03:20:28.770Z","dependency_job_id":null,"html_url":"https://github.com/gabrieltheodoropoulos/GTRest","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrieltheodoropoulos%2FGTRest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrieltheodoropoulos%2FGTRest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrieltheodoropoulos%2FGTRest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrieltheodoropoulos%2FGTRest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabrieltheodoropoulos","download_url":"https://codeload.github.com/gabrieltheodoropoulos/GTRest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243950792,"owners_count":20373664,"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":["ios","rest","restful-webservices","swift","web-services"],"created_at":"2024-11-23T00:27:43.980Z","updated_at":"2026-01-04T11:02:33.069Z","avatar_url":"https://github.com/gabrieltheodoropoulos.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GTRest\nA lightweight Swift library for making web requests and consuming RESTful APIs!\n\n![Platform](https://img.shields.io/cocoapods/p/GTRest.svg)\n![Language](https://img.shields.io/github/languages/top/gabrieltheodoropoulos/GTRest.svg?color=orange)\n![License](https://img.shields.io/github/license/gabrieltheodoropoulos/GTRest.svg)\n![Version](https://img.shields.io/cocoapods/v/GTRest.svg)\n\n## Adding GTRest to your project\n\n### Using CocoaPods\n\nIn your Podfile add:\n\n```ruby\npod 'GTRest'\n```\n\nDon't forget to import GTRest anywhere you want to use it in your project:\n\n```swift\nimport GTRest\n```\n\n### Manually\n\nDownload or clone the repository, and add the files in *GTRest/Source* directory to your project.\n\n## Usage\n\nMaking web requests with GTRest is really simple and straightforward!\n\nSee the [Documentation](https://gtiapps.com/docs/gtrest/index.html) generated by [jazzy](https://github.com/realm/jazzy) on how to use GTRest.\n\nA quick example:\n\n```swift\nlet url = URL(...) // A URL object.\nlet rest = GTRest()\n\n// Set any request HTTP headers:\nrest.requestHttpHeaders.add(value: \"application/json\", forKey: \"Accept\")\n\n// Set any URL query parameters:\nrest.urlQueryParameters.add(value: \"2\", forKey: \"page\")\n\n// Make a request.\nrest.makeRequest(toURL: url, httpMethod: .get) { [unowned self] (results) in // or [weak self] (results) in\n    // Access data returned by the server:\n    if let data = results.data {\n        // Perform app-specific actions\n    }\n\n    // Access the response:\n    if let response = results.response {\n        // Do something with the response object if necessary.\n        // Checking the HTTP status code :\n        if (200...299).contains(response.httpStatusCode) {\n            // Successful request.\n        } else { ... }\n    }\n\n    // Access the error:\n    if let error = results.error {\n        // Do something with the error.\n    }\n\n    // Always update your UI on main thread:\n    DispatchQueue.main.async {\n        // Update UI.\n    }\n}\n```\n\n## Requirements\n\niOS 11.0 and above.\n\n## See Also\n\nYou might be also interested in [GTNetMon](https://github.com/gabrieltheodoropoulos/GTNetMon), another Swift library to get network status and connection information, and to monitor for network changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrieltheodoropoulos%2Fgtrest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrieltheodoropoulos%2Fgtrest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrieltheodoropoulos%2Fgtrest/lists"}