{"id":29670298,"url":"https://github.com/konak/am.kon.packages.services.web-client-service","last_synced_at":"2025-07-22T19:09:29.489Z","repository":{"id":137989827,"uuid":"597424844","full_name":"konak/am.kon.packages.services.web-client-service","owner":"konak","description":"The WebClientService package provides a robust and flexible web client component designed to be used as a service within .NET Core applications. It leverages the power of 'IHttpClientFactory' to facilitate efficient and scalable interactions with web services.","archived":false,"fork":false,"pushed_at":"2025-06-01T18:04:02.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-02T03:38:03.726Z","etag":null,"topics":["ihttpclientfactory","webclient"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/konak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-02-04T14:09:31.000Z","updated_at":"2025-06-01T18:04:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"71e10d29-f328-4504-8c54-3fd962792947","html_url":"https://github.com/konak/am.kon.packages.services.web-client-service","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/konak/am.kon.packages.services.web-client-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konak%2Fam.kon.packages.services.web-client-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konak%2Fam.kon.packages.services.web-client-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konak%2Fam.kon.packages.services.web-client-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konak%2Fam.kon.packages.services.web-client-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/konak","download_url":"https://codeload.github.com/konak/am.kon.packages.services.web-client-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konak%2Fam.kon.packages.services.web-client-service/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266555212,"owners_count":23947484,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["ihttpclientfactory","webclient"],"created_at":"2025-07-22T19:09:29.011Z","updated_at":"2025-07-22T19:09:29.474Z","avatar_url":"https://github.com/konak.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![.NET](https://github.com/konak/am.kon.packages.services.web-client-service/actions/workflows/dotnet.yml/badge.svg)](https://github.com/konak/am.kon.packages.services.web-client-service/actions/workflows/dotnet.yml)\n\n# WebClientService for .NET Core\n\nThe WebClientService package provides a robust and flexible web client component designed to be used as a service within .NET Core applications. It leverages the power of '**IHttpClientFactory**' to facilitate efficient and scalable interactions with web services. This package supports dependency injection, making it easy to integrate into your existing .NET Core applications.\n\n## Key Features:\n- **Dependency Injection**: Seamlessly integrates with the .NET Core dependency injection framework.\n- **HTTP Client Management**: Utilizes '**IHttpClientFactory**' for robust HTTP client instantiation and management.\n- **Result Handling**: Comprehensive handling of HTTP response results with detailed status and error information.\n- **Extensible Base Classes**: Abstract base classes for implementing services that interact with web endpoints, returning various data types including strings and streams.\n- **Configurable Requests**: Supports various HTTP methods, custom headers, bearer token authentication, and more.\n\n## Usage Scenarios:\n- Consuming RESTful APIs\n- Fetching data from web services\n- Handling HTTP responses with rich error information\n- Streaming data from endpoints\n\n## Getting Started:\n\n1. **Installation**: Install the package via NuGet Package Manager.\n\n```shell\ndotnet add package WebClientService\n```\n\n2. **Configuration**: Configure IHttpClientFactory in your Startup.cs.\n\n```C#\npublic void ConfigureServices(IServiceCollection services)\n{\n    services.AddHttpClient();\n    services.AddScoped\u003cWebClientStringDataService\u003e();\n    services.AddScoped\u003cWebClientStreamDataService\u003e();\n}\n```\n\n3. **Usage**: Inject the service into your controllers or services and start making web requests.\n\n```C#\npublic class MyService\n{\n    private readonly WebClientStringDataService _webClient;\n\n    public MyService(WebClientStringDataService webClient)\n    {\n        _webClient = webClient;\n    }\n\n    public async Task\u003cstring\u003e GetDataAsync(Uri requestUri)\n    {\n        var result = await _webClient.InvokeRequest(requestUri);\n        if (result.Result == RequestInvocationResultTypes.Ok)\n        {\n            return result.Data;\n        }\n        else\n        {\n            // Handle error\n            throw new Exception(result.Message);\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonak%2Fam.kon.packages.services.web-client-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonak%2Fam.kon.packages.services.web-client-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonak%2Fam.kon.packages.services.web-client-service/lists"}