{"id":31913791,"url":"https://github.com/wilhelmoks/kreerequest","last_synced_at":"2026-05-16T17:35:31.878Z","repository":{"id":269084330,"uuid":"906375309","full_name":"WilhelmOks/KreeRequest","owner":"WilhelmOks","description":"A lightweight http request helper for JSON REST APIs","archived":false,"fork":false,"pushed_at":"2025-08-09T15:25:48.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T17:25:48.831Z","etag":null,"topics":["api","http","json","request","rest","rest-api","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/WilhelmOks.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,"zenodo":null}},"created_at":"2024-12-20T19:00:18.000Z","updated_at":"2025-08-09T15:25:29.000Z","dependencies_parsed_at":"2025-08-09T17:15:43.816Z","dependency_job_id":"4c1ef4f4-c1c3-4a0f-857a-0683562f5d8b","html_url":"https://github.com/WilhelmOks/KreeRequest","commit_stats":null,"previous_names":["wilhelmoks/kreerequest"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/WilhelmOks/KreeRequest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilhelmOks%2FKreeRequest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilhelmOks%2FKreeRequest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilhelmOks%2FKreeRequest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilhelmOks%2FKreeRequest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WilhelmOks","download_url":"https://codeload.github.com/WilhelmOks/KreeRequest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilhelmOks%2FKreeRequest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016624,"owners_count":26085853,"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-10-13T02:00:06.723Z","response_time":61,"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":["api","http","json","request","rest","rest-api","swift"],"created_at":"2025-10-13T18:50:41.196Z","updated_at":"2025-10-13T18:52:47.823Z","avatar_url":"https://github.com/WilhelmOks.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KreeRequest\nA lightweight http request helper for JSON REST APIs.\n\nImplemented with `AsyncHTTPClient` rather than `URLSession` and can be used on Linux and Windows.\n\n_The name Kree comes from the TV Series Stargate SG-1, where it means something like \"Hey!\" in the alien language of the Goa'Uld._\n\n## Usage\n\n```swift\nimport KreeRequest\n```\n\nCreate an instance of `KreeRequest` and give it an encoder and a decoder:\n```swift\nlet request = KreeRequest(encoder: JSONEncoder(), decoder: JSONDecoder())\n```\n\nOptionally give it a logger so that you can see all the data that is sent and received during the request:\n```swift\nstruct MyLogger: Logger {\n    func log(_ message: String) {\n        print(message)\n    }\n}\n\nlet request = KreeRequest(encoder: JSONEncoder(), decoder: JSONDecoder(), logger: MyLogger())\n```\n\nDefine a type for the url of the backend that you want to access:\n```swift\nstruct MyBackend: Backend {\n    let baseURL = \"https://example.com/\"\n}\n```\n\nTo perform a request, first create a config for that request.\nProvide a method (GET, POST, PUT, etc.), the backend and a path that will be appended to the baseURL of the backend:\n```swift\nlet config = KreeRequest.Config(method: .post, backend: MyBackend(), path: \"cheese\")\n```\n\nOptionally provide urlParameters:\n```swift\nlet config = KreeRequest.Config(method: .post, backend: MyBackend(), path: \"cheese\", urlParameters: [\"age\":\"5\"])\n```\n... and/or http headers:\n```swift\nlet config = KreeRequest.Config(method: .post, backend: MyBackend(), path: \"cheese\", headers: [\"Content-Type\": \"application/json\"])\n```\n\nPerform the request:\n```swift\ntry await request.requestJson(config: config)\n```\n\nPass data to the request:\n```swift\nstruct Milk: Encodable {\n    var name = \"\"\n}\n\ntry await request.requestJson(config: config, json: Milk())\n```\nThe `Milk` object will be encoded as JSON and will be sent in the http body.\n\nGet data back from the request:\n```swift\nstruct Cheese: Decodable {\n    let name: String\n}\n\nlet cheese: Cheese = try await request.requestJson(config: config)\n```\nThe http body from the response will be decoded from JSON to the `Cheese` object.\n\nOptionally provide the Error type for the JSON REST API:\n```swift\nstruct ApiError: Error, Decodable {\n    let message: String\n}\n\ntry await request.requestJson(config: config, apiError: ApiError.self)\n```\nIf the request responds with an error and the body contains JSON encoded information about the error, the error `KreeRequest.Error.apiError(ApiError)` will be thrown, containing the decoded error object.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilhelmoks%2Fkreerequest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilhelmoks%2Fkreerequest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilhelmoks%2Fkreerequest/lists"}