{"id":15442282,"url":"https://github.com/oguzhan18/alaz","last_synced_at":"2026-01-27T09:43:29.440Z","repository":{"id":257792034,"uuid":"861905508","full_name":"oguzhan18/alaz","owner":"oguzhan18","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-23T18:03:33.000Z","size":10,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T20:59:37.481Z","etag":null,"topics":["flutter","http-client","http-library","library","pacakge"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/alaz","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oguzhan18.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":"2024-09-23T17:50:56.000Z","updated_at":"2024-09-24T07:57:01.000Z","dependencies_parsed_at":"2024-09-23T19:54:21.587Z","dependency_job_id":null,"html_url":"https://github.com/oguzhan18/alaz","commit_stats":null,"previous_names":["oguzhan18/alaz"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/oguzhan18/alaz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oguzhan18%2Falaz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oguzhan18%2Falaz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oguzhan18%2Falaz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oguzhan18%2Falaz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oguzhan18","download_url":"https://codeload.github.com/oguzhan18/alaz/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oguzhan18%2Falaz/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28811349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["flutter","http-client","http-library","library","pacakge"],"created_at":"2024-10-01T19:26:12.427Z","updated_at":"2026-01-27T09:43:29.432Z","avatar_url":"https://github.com/oguzhan18.png","language":"Dart","readme":"# Alaz\n\n[![pub package](https://img.shields.io/pub/v/alaz.svg)](https://pub.dev/packages/alaz)\n\nAlaz is a powerful and customizable HTTP client for Dart and Flutter. It includes features such as retry mechanism, interceptors, request cancellation, caching, and more.\n\n## Features\n\n- **HTTP Requests**: Supports GET, POST, and other HTTP methods.\n- **Retry Mechanism**: Automatically retries failed requests.\n- **Interceptors**: Add interceptors to modify requests, responses, or handle errors.\n- **Request Cancellation**: Easily cancel ongoing HTTP requests.\n- **Caching**: Cache HTTP responses to improve performance.\n- **Timeout Control**: Customize connection and response timeouts.\n- **Proxy Support**: Send requests through a proxy server.\n- **Chained Requests**: Chain multiple HTTP requests.\n\n## Installation\n\nAdd `alaz` to your `pubspec.yaml` file:\n\n```yaml\ndependencies:\n  alaz: ^1.0.0\n```\n## Then run:\n```bash\nflutter pub get\n```\n## Getting Started\nHere’s how to use Alaz in your project:\n### Basic Usage\n```dart\nimport 'package:alaz/alaz.dart';\n\nvoid main() async {\n  final alaz = Alaz();\n\n  // Simple GET request\n  final response = await alaz.get('https://jsonplaceholder.typicode.com/posts/1');\n  print(response.data);\n\n  // POST request with data\n  final postResponse = await alaz.post('https://jsonplaceholder.typicode.com/posts',\n    data: {'title': 'foo', 'body': 'bar', 'userId': 1});\n  print(postResponse.data);\n}\n\n```\n## Retry Mechanism:\nAlaz automatically retries failed requests based on the configured `retryCount`.\n```dart\nfinal alaz = Alaz(\n  options: AlazOptions(retryCount: 3),\n);\n\ntry {\n  final response = await alaz.get('https://invalid-url');\n} catch (e) {\n  print('Request failed after 3 retries.');\n}\n\n```\n### Interceptors\nYou can add interceptors to modify requests, responses, or handle errors.\n\n```dart\nfinal alaz = Alaz();\nalaz.addInterceptor(TestInterceptor(\n  onRequestCallback: (AlazRequest request) async {\n    print('Requesting: ${request.path}');\n  },\n  onResponseCallback: (AlazResponse response) async {\n    print('Response received: ${response.statusCode}');\n  },\n  onErrorCallback: (error) async {\n    print('Error occurred: $error');\n  },\n));\n\n```\n### Request Cancellation\nYou can cancel ongoing requests using `CancelToken`.\n```dart\nfinal alaz = Alaz();\nfinal cancelToken = CancelToken();\n\nalaz.get('https://jsonplaceholder.typicode.com/posts/1', cancelToken: cancelToken);\n\ncancelToken.cancel();\n\n```\n### Timeout Configuration\nYou can set custom timeouts for requests.\n\n```dart\nfinal alaz = Alaz(\n  options: AlazOptions(connectTimeout: 5000, receiveTimeout: 3000),\n);\n\ntry {\n  final response = await alaz.get('https://jsonplaceholder.typicode.com/posts/1');\n} catch (e) {\n  print('Request timed out.');\n}\n\n```\n\n### Proxy Support\nAlaz can send requests through a proxy.\n```dart\nfinal alaz = Alaz(\n  options: AlazOptions(proxy: 'http://proxy-server.com:8080'),\n);\n\nfinal response = await alaz.get('https://jsonplaceholder.typicode.com/posts/1');\n\n```\n### Chained Requests\nYou can chain multiple requests together.\n```dart\nfinal alaz = Alaz();\n\nfinal firstResponse = await alaz.get('https://jsonplaceholder.typicode.com/posts/1');\nfinal secondResponse = await alaz.get('https://jsonplaceholder.typicode.com/posts/2');\n\nfinal chainedResponse = await alaz.chainRequests(firstResponse, secondResponse);\nprint(chainedResponse.data);\n\n```\n### Testing\nTo run the tests, simply use the `flutter test` command:\n```bash\nflutter test\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foguzhan18%2Falaz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foguzhan18%2Falaz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foguzhan18%2Falaz/lists"}