{"id":17962641,"url":"https://github.com/eneko/jab","last_synced_at":"2026-04-28T08:03:16.389Z","repository":{"id":136800862,"uuid":"74864844","full_name":"eneko/Jab","owner":"eneko","description":"Jab is a Swift 3 library that does synchronous HTTP JSON requests","archived":false,"fork":false,"pushed_at":"2016-11-27T08:18:11.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T19:21:56.345Z","etag":null,"topics":["json","network","swift"],"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/eneko.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-27T03:29:06.000Z","updated_at":"2016-11-27T07:38:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"1d9e44f0-b853-430d-9c81-21a6e5b50ff7","html_url":"https://github.com/eneko/Jab","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/eneko/Jab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eneko%2FJab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eneko%2FJab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eneko%2FJab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eneko%2FJab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eneko","download_url":"https://codeload.github.com/eneko/Jab/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eneko%2FJab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32371673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"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":["json","network","swift"],"created_at":"2024-10-29T11:19:59.541Z","updated_at":"2026-04-28T08:03:16.371Z","avatar_url":"https://github.com/eneko.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jab\nJab is a Swift 3 library that does synchronous HTTP __JSON__ requests\n\n![](https://img.shields.io/cocoapods/v/Jab.svg)\n![](http://img.shields.io/badge/iOS-8.4%2B-blue.svg)\n![](http://img.shields.io/badge/Swift-3.0.1-orange.svg)\n\nMany iOS, command line or server side applications rely on getting or sending\nJSON from/to some remote server on Internet or local network.\n\nJab is a tiny library that handles those JSON network requests for you,\nincluding serialization of payloads (anything serializable by JSONSerialization)\nand deserialization of responses.\n\n## Simple requests without Futures, Promises or Callback blocks\n\n```swift\nlet clients = try Jab().get(url: \"http://example.com/clients\")\n```\n\n```swift\nlet newClient: [String, Any] = [\n    \"first_name\": \"Jon\",\n    \"last_name\": \"Doe\",\n    \"age\": 31\n]\ntry Jab().post(url: \"http://example.com/clients\", payload: newClient)\n```\n\n## Sequential requests\n\n```swift\nlet bob = try Jab().get(url: \"http://example.com/clients/bob\")\nlet alice = try Jab().get(url: \"http://example.com/clients/alice\")\nlet janey = try Jab().get(url: \"http://example.com/clients/janey\")\nreturn [bob, alice, janey]\n```\n\nSynchronous network requests are great for many reasons:\n- Simplify business logic\n- Allow for natural chaining of operations\n- Delegate control of UI workflows to your application UI layer.\n\nSee more working sample requests in our [Integration Tests](/Tests/IntegrationTests.swift).\n\n\n## Error handling\n\nJab uses [Swift exception based error handling](https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/ErrorHandling.html).\n\nThe following are all errors thrown by Jab if something bad happens:\n\n```swift\npublic enum JabError: Error {\n    case offline\n    case invalidRequest\n    case serialization\n    case deserialization\n    case noResponse\n    case requestFailed(error: Error)\n}\n```\n\n## Mind your application user interface\n\nIf you are using Jab in an application with a graphic user interface, make sure\nto run any requests in a background thread with the proper QoS priority:\n\n```swift\noverride func viewDidLoad() {\n    super.viewDidLoad()\n    DispatchQueue.global(qos: .userInitiated).async { [weak self] in\n        do {\n          self?.clients = try Jab().get(url: \"http://example.com/clients.json\")\n        } catch {\n          // Handle errors accordingly\n          self.clients = nil\n        }\n        DispatchQueue.main.async {\n            self?.tableView.reloadData()\n        }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feneko%2Fjab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feneko%2Fjab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feneko%2Fjab/lists"}