{"id":25731167,"url":"https://github.com/grdsdev/swift-http","last_synced_at":"2025-12-11T23:00:43.685Z","repository":{"id":271700900,"uuid":"876024154","full_name":"grdsdev/swift-http","owner":"grdsdev","description":"The HTTP package provides a Swift interface for making HTTP requests and processing responses.","archived":true,"fork":false,"pushed_at":"2025-05-05T17:45:08.000Z","size":78,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-13T08:52:40.399Z","etag":null,"topics":[],"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/grdsdev.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-10-21T09:18:27.000Z","updated_at":"2025-06-23T14:02:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"a06d8dff-4331-4c41-b008-de17f901f7a4","html_url":"https://github.com/grdsdev/swift-http","commit_stats":null,"previous_names":["grdsdev/swift-fetch"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/grdsdev/swift-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grdsdev%2Fswift-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grdsdev%2Fswift-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grdsdev%2Fswift-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grdsdev%2Fswift-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grdsdev","download_url":"https://codeload.github.com/grdsdev/swift-http/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grdsdev%2Fswift-http/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273309462,"owners_count":25082543,"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-09-02T02:00:09.530Z","response_time":77,"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":[],"created_at":"2025-02-26T02:36:58.812Z","updated_at":"2025-12-11T23:00:38.288Z","avatar_url":"https://github.com/grdsdev.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTTP\n[![codecov](https://codecov.io/gh/grdsdev/swift-http/graph/badge.svg?token=E4i22yGg9o)](https://codecov.io/gh/grdsdev/swift-http)\n\nThe `HTTP` package provides a Swift interface for making HTTP requests and\nprocessing responses. It is designed to be simple and intuitive, allowing developers to easily integrate HTTP functionality into their Swift applications.\n\n## Features\n\n- Simple and intuitive API for making HTTP requests\n- Support for various HTTP methods (GET, POST, PUT, DELETE, etc.)\n- Flexible request options, including custom headers and body\n- Asynchronous operations using Swift's async/await\n- Built-in support for JSON encoding and decoding\n- Multipart form data support\n- URL search parameters handling\n- Support for streamed responses\n\n## Installation\n\nTo integrate the `HTTP` package into your Swift project, add the following line to your `Package.swift` file:\n\n```swift\n.package(url: \"https://github.com/grdsdev/swift-http.git\", from: \"0.0.1\")\n```\n\nThen, include \"HTTP\" in your target dependencies:\n\n```swift\n.target(\n  name: \"YourTargetName\", \n  dependencies: [\n    .product(name: \"HTTP\", package: \"swift-http\"), \n    .product(name: \"HTTPFoundation\", package: \"swift-http\"),\n  ]\n)\n```\n\n## Usage\n\n### Basic GET Request\n\n```swift\nimport HTTP\nimport HTTPFoundation\n\nlet response = try await http.get(\"https://api.example.com/data\")\nlet json = try await response.json()\n```\n\n### POST Request with JSON Body\n\n```swift\nimport HTTP\nimport HTTPFoundation\n\nlet response = try await http.post(\n  \"https://api.example.com/users\", \n  body: [\"name\": \"John Doe\", \"age\": 30]\n)\n```\n\n### Multipart Form Data\n\n```swift\nimport HTTP\nimport HTTPFoundation\n\nvar formData = FormData()\nformData.append(\"username\", \"johndoe\")\nformData.append(\"avatar\", imageData, filename: \"avatar.jpg\", contentType: \"image/jpeg\")\n\nlet response = try await http.post(\n  \"https://api.example.com/upload\", \n  body: formData\n)\n```\n\n### URL Search Parameters\n\n```swift\nimport HTTP\n\nvar params = URLSearchParams(\"https://example.com?foo=1\u0026bar=2\")\nparams.append(\"baz\", \"3\")\nprint(params.description) // Output: foo=1\u0026bar=2\u0026baz=3\n```\n\n### Streamed Responses\n\n```swift\nimport HTTP\nimport HTTPFoundation\n\nlet response = try await http.get(\"https://api.example.com/stream\")\n\nfor await chunk in response.body {\n  // handle chunk of Data\n}\n```\n\n# API Reference\n\nFor detailed API documentation, please refer to the inline comments in the\nsource code.\n\n## Requirements\n\n- Swift 5.9+\n- macOS 10.15+ or iOS 13.0+\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file\nfor details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrdsdev%2Fswift-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrdsdev%2Fswift-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrdsdev%2Fswift-http/lists"}