{"id":20565166,"url":"https://github.com/presscorp/networkxi","last_synced_at":"2025-04-14T15:23:04.736Z","repository":{"id":149513271,"uuid":"613047054","full_name":"presscorp/NetworkXI","owner":"presscorp","description":"Exquisite networking package for iOS","archived":false,"fork":false,"pushed_at":"2023-09-22T13:47:07.000Z","size":52,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-25T05:42:44.733Z","etag":null,"topics":["async-await","ios","networking","swift","web-socket"],"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/presscorp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-03-12T18:24:12.000Z","updated_at":"2023-04-10T23:00:49.000Z","dependencies_parsed_at":"2024-11-16T04:42:46.357Z","dependency_job_id":null,"html_url":"https://github.com/presscorp/NetworkXI","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/presscorp%2FNetworkXI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/presscorp%2FNetworkXI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/presscorp%2FNetworkXI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/presscorp%2FNetworkXI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/presscorp","download_url":"https://codeload.github.com/presscorp/NetworkXI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248904792,"owners_count":21180855,"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","ios","networking","swift","web-socket"],"created_at":"2024-11-16T04:32:39.093Z","updated_at":"2025-04-14T15:23:04.712Z","avatar_url":"https://github.com/presscorp.png","language":"Swift","readme":"# NetworkXI\n\n### Exquisite networking package for iOS (version \u003e= 13.0)\n\n\u003cbr\u003e\n\n## List of features\n- NetworkXI utilizes fundamental `URLSession` under the hood\n- NetworkXI exclusively takes advantage of *Async/await* approach for request making\n- All interactions with NetworkXI are based on protocols, so you can make your own implementations of\n`NetworkSessionInterface`, `NetworkService`\n- NetworkXI provides logger that prints beautifully crafted request/response events into *Xcode* console\n- NetworkXI provides the opportunity to renew session by updating authorization\n- NetworkXI supports SSL certificate pinning along with default challenge\n- NetworkXI supports easily implemented response mocking\n- NetworkXI supports response caching feature\n- NetworkXI supports separate implementation (`WebSocketSessionInterface`, `WebSocketService`) of web-socket message\nexchange\n\n\u003cbr\u003e\n\n## Example of use\n\n#### Creating URL list\n```Swift\nimport NetworkXI\n\nstruct HttpbinOrgURL: RequestURLExtensible {\n\n    let path: String\n    var host: String { \"httpbin.org\" }\n}\n\nextension HttpbinOrgURL {\n\n    static let uuid = Self(\"/uuid\")\n}\n\n```\n\n#### Describing request\n```Swift\nimport NetworkXI\n\nclass UUIDRequest: NetworkRequest {\n\n    var url: RequestURL { HttpbinOrgURL.uuid }\n    var method: RequestMethod { .GET }\n    var encoding: RequestContentEncoding { .url }\n}\n\n```\n\n#### Making the request\n```Swift\nimport NetworkXI\n\n// Create session interface and use it across the app\nlet sessionAdapter = NetworkSessionAdapter()\nsessionAdapter.defaultSSLChallengeEnabled = true\n\n// Work with a new instance of network service\nlet worker = NetworkWorker(sessionInterface: sessionAdapter)\n\nlet request = UUIDRequest()\nlet response = await worker.make(request)\n\nif response.success,\n   let body = response.jsonBody,\n   let uuidString = body[\"uuid\"] as? String {\n    print(\"UUID: \" + uuidString)\n}\n```\n\n\u003cbr\u003e\n\n## License\n\n**NetworkXI** is released under the **MIT** license\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpresscorp%2Fnetworkxi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpresscorp%2Fnetworkxi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpresscorp%2Fnetworkxi/lists"}