{"id":20308435,"url":"https://github.com/0xdir/connection_dart","last_synced_at":"2026-06-01T06:31:48.168Z","repository":{"id":179641509,"uuid":"663892694","full_name":"0xdir/connection_dart","owner":"0xdir","description":"An opinionated wrapper around the revered http package, where http responses are objects  for easy parsing and error handling.","archived":false,"fork":false,"pushed_at":"2023-07-09T02:59:48.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-19T08:14:33.374Z","etag":null,"topics":["api-rest","dart","https","tooling"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/connection","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/0xdir.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}},"created_at":"2023-07-08T11:21:23.000Z","updated_at":"2024-10-22T05:05:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"7cf8309a-c98b-4f15-847e-3b0ee6be6aee","html_url":"https://github.com/0xdir/connection_dart","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"0c943efce09e6b9dfaf9f7754b394b07319fae36"},"previous_names":["0xdir/connection_dart"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/0xdir/connection_dart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xdir%2Fconnection_dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xdir%2Fconnection_dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xdir%2Fconnection_dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xdir%2Fconnection_dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xdir","download_url":"https://codeload.github.com/0xdir/connection_dart/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xdir%2Fconnection_dart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33763648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"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-rest","dart","https","tooling"],"created_at":"2024-11-14T17:22:26.503Z","updated_at":"2026-06-01T06:31:48.150Z","avatar_url":"https://github.com/0xdir.png","language":"Dart","funding_links":["https://github.com/sponsors/0xdir"],"categories":[],"sub_categories":[],"readme":"[![pub package](https://img.shields.io/pub/v/connection.svg)](https://pub.dev/packages/connection)\n[![package publisher](https://img.shields.io/pub/publisher/connection.svg)](https://pub.dev/packages/connection/publisher)\n\nAn opinionated wrapper around the revered http package, where HTTP responses are objects \nfor easy parsing and error handling.\n\n## Using\n\nThe easiest way to use this library is via the top-level ```Connection``` class.\n\n```dart\nimport 'package:connection/connection.dart';\n\nvoid main() async {\n\n  /// Initialize the main object\n  Connection connection = Connection(\n    authority: 'swapi.dev',\n    defaultHeaders: {'Content-Type': 'application/json'},\n  );\n  \n  try {\n    /// Call the endpoint\n    Response response = await connection.get(\n      endpoint: '/api/people/1',\n    );\n    if (response.statusCode == 200) {\n      /// Do stuff with the response\n      print(response.statusCode);\n      print(json.decode(response.body));\n    } else {\n      /// Handle the server error\n      print('Server Error: ${response.statusCode}:');\n      print(response.body);\n    }\n  } catch (e) {\n    /// Throws an exception if an unknown error occurs\n    print(e);\n  }\n\n  /// Close the connection\n  connection.close();\n}\n```\n\n## Supported calls\n\nImplemented:\n1. https \n2. default and custom headers\n3. GET with query params\n4. POST with payload\n\nNot implemented:\n1. everything else\n\nIf more features are needed, feel free to open a discussion on github.\n\n## Getting Help\n\nSubmit an issue on [github].\n\n[github]: https://github.com/0xdir/connection_dart\n\n## How to contribute\n\nAll feedback and suggestions for improvements are welcome:\n\n1. Open a discussion on [github]\n2. Discuss proposed changes\n3. Submit a PR (optional)\n\n[github]: https://github.com/0xdir/connection_dart\n\n## Support my work\n\nThis package is possible thanks to the people and companies\nwho donate money, services or time to keep the project running.\n\nIf you're interested in becoming a Sponsor, Backer or Contributor\nto expand the project, reach out to me on [github].\n\n[github]: https://github.com/sponsors/0xdir\n\nOr buy me coffee at `0xdir.near`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xdir%2Fconnection_dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xdir%2Fconnection_dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xdir%2Fconnection_dart/lists"}