{"id":19005284,"url":"https://github.com/f3ath/dart-http-interop","last_synced_at":"2026-02-04T01:02:10.736Z","repository":{"id":153285417,"uuid":"628794567","full_name":"f3ath/dart-http-interop","owner":"f3ath","description":"A thin package to allow interoperability between HTTP different client and server implementations in Dart","archived":false,"fork":false,"pushed_at":"2024-12-24T21:30:26.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-17T10:26:26.333Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","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/f3ath.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-04-17T01:58:55.000Z","updated_at":"2025-04-17T06:21:47.000Z","dependencies_parsed_at":"2024-12-24T20:22:02.719Z","dependency_job_id":"a9e4000f-2c1f-4d89-9873-76c702b60b7d","html_url":"https://github.com/f3ath/dart-http-interop","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3ath%2Fdart-http-interop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3ath%2Fdart-http-interop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3ath%2Fdart-http-interop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3ath%2Fdart-http-interop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f3ath","download_url":"https://codeload.github.com/f3ath/dart-http-interop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250305105,"owners_count":21408919,"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":[],"created_at":"2024-11-08T18:26:57.544Z","updated_at":"2026-02-04T01:02:10.701Z","avatar_url":"https://github.com/f3ath.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# http_interop\n\nThis is a lightweight package that facilitates interoperability between different HTTP client and server implementations in Dart. \nIt defines the `Request` and `Response` classes and a universal client/server `Handler` interface: `Future\u003cResponse\u003e Function(Request request)`.\n\n## Motivation\n\nOne of the most popular solutions for client-server interaction is an HTTP API where each request and response fit in a single HTTP message. \nA prime example is the [pub.dev API](https://pub.dev/help/api). Implementing a client (or server, or both) for such an API often involves basing your client on top of an HTTP client, \nleading to the risks of tight coupling with a particular HTTP client implementation. This coupling raises issues related to testability, potentially requiring unwanted mocking in unit-level tests or relying on end-to-end tests, both of which can limit coverage and make testing cumbersome.\n\n## Solution\n\nWith this package, rather than coupling to a specific HTTP-level implementation, you can implement a single `Handler` function. The `Request` and `Response` classes are simple Dart classes that can be \ninstantiated and analyzed directly in tests, offering a straightforward API.\n## Pros\n\n- Decouples code from underlying HTTP delivery mechanisms.\n- Simplifies and cleans up tests, whether you're developing a client or a server.\n- Eliminates the need for an HTTP stack in tests.\n- Allows users to use their preferred HTTP client or server with your library, and they can even switch between clients.\n\n## Cons\n\n- Limited capabilities when using a streaming API, long polling, or web sockets.\n- Introduces an additional dependency to your library.\n- Adds at least two more dependencies (the interop package itself and the client/server wrapper) to your customers' projects.\n\n## Existing Implementations\n\n- [http_interop_http](https://pub.dev/packages/http_interop_http) - a wrapper over the standard Dart HTTP client.\n- [http_interop_io](https://pub.dev/packages/http_interop_io) - wrappers over the dart:io server and client.\n- [http_interop_dio](https://pub.dev/packages/http_interop_dio) - a wrapper over the Dio HTTP client adapter.\n\n## Where http_interop is used\n\n- [json_api](https://pub.dev/packages/json_api) - JSON:API client/server.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff3ath%2Fdart-http-interop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff3ath%2Fdart-http-interop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff3ath%2Fdart-http-interop/lists"}