{"id":23721206,"url":"https://github.com/byndyusoft/byndyusoft.net.http.protobuf","last_synced_at":"2026-02-14T04:38:32.567Z","repository":{"id":43081825,"uuid":"316917331","full_name":"Byndyusoft/Byndyusoft.Net.Http.ProtoBuf","owner":"Byndyusoft","description":"Provides extension methods for System.Net.Http.HttpClient and System.Net.Http.HttpContent that perform automatic serialization and deserialization using ProtoBuf","archived":false,"fork":false,"pushed_at":"2024-12-17T13:57:25.000Z","size":98,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-30T22:18:07.646Z","etag":null,"topics":["byndyusoft","http","protobuf","webapi"],"latest_commit_sha":null,"homepage":"https://en.byndyusoft.com","language":"C#","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/Byndyusoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-11-29T09:33:34.000Z","updated_at":"2024-12-17T13:54:06.000Z","dependencies_parsed_at":"2023-12-01T08:37:15.436Z","dependency_job_id":null,"html_url":"https://github.com/Byndyusoft/Byndyusoft.Net.Http.ProtoBuf","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Byndyusoft%2FByndyusoft.Net.Http.ProtoBuf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Byndyusoft%2FByndyusoft.Net.Http.ProtoBuf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Byndyusoft%2FByndyusoft.Net.Http.ProtoBuf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Byndyusoft%2FByndyusoft.Net.Http.ProtoBuf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Byndyusoft","download_url":"https://codeload.github.com/Byndyusoft/Byndyusoft.Net.Http.ProtoBuf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239816363,"owners_count":19701752,"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":["byndyusoft","http","protobuf","webapi"],"created_at":"2024-12-30T22:18:11.199Z","updated_at":"2026-02-13T01:30:16.806Z","avatar_url":"https://github.com/Byndyusoft.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[Protocol Buffers](https://developers.google.com/protocol-buffers) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. \n\n## Byndyusoft.Net.Http.ProtoBuf\n[![(License)](https://img.shields.io/github/license/Byndyusoft/Byndyusoft.Net.Http.ProtoBuf.svg)](LICENSE.txt)\n[![Nuget](http://img.shields.io/nuget/v/Byndyusoft.Net.Http.ProtoBuf.svg?maxAge=10800)](https://www.nuget.org/packages/Byndyusoft.Net.Http.ProtoBuf/) [![NuGet downloads](https://img.shields.io/nuget/dt/Byndyusoft.Net.Http.ProtoBuf.svg)](https://www.nuget.org/packages/Byndyusoft.Net.Http.ProtoBuf/) \n\nProvides extension methods for System.Net.Http.HttpClient and System.Net.Http.HttpContent that perform automatic serialization and deserialization using ProtoBuf.\n\nThis package actually depends on ```Microsoft.Net.Http```, and extends the ```HttpClient``` with ```ProtoBuf```\nfeatures that you would likely need to talk to a RESTful service such as ASP.NET Web API.\nPackage operates in the ```System.Net.Http``` namespace and adds some handy extension methods to ```HttpClient``` and ```HttpContent```.\n\nSo for example:\n\n```csharp\nusing (var client = new HttpClient())\n{\n    var product = await client.GetFromProtoBufAsync\u003cProduct\u003e(\"http://localhost/api/products/1\");\n}\n```\nor\n```csharp\nusing (var client = new HttpClient())\n{\n    var response = await _client.GetAsync(\"http://localhost/api/products/1\");\n    response.EnsureSuccessStatusCode();\n    var product = await response.Content.ReadFromProtoBufAsync\u003cProduct\u003e();\n}\n```\nor\n```csharp\nusing (var client = new HttpClient())\n{\n    var request = new HttpRequestMessage(HttpMethod.Post, \"http://localhost/api/products/1\");\n    request.Content = ProtoBufContent.Create(new Product());\n    var response = await _client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n}\n```\n\nIf you tried to just use ```Microsoft.Net.Http```, the ```GetFromProtoBufAsync``` method wouldn't be available to you, and you'd only be able to read the content \nas raw data such as bytes or string, and have to do the serializing / de-serializing yourself.\n\nYou also get extension methods to PUT / POST back to the service in ```ProtoBuf``` format without having to do that yourself:\n\n```csharp\nawait client.PutAsProtoBufAsync(\"http://localhost/api/products/1\", product);\nawait client.PostAsProtoBufAsync(\"http://localhost/api/products/1\", product);\n```\n\nThis package also adds `ProtoBufMediaTypeFormatter` class for formatting `HttpClient` requests and responses:\n\n```csharp\nusing (var client = new HttpClient())\n{\n\tvar formatter = new ProtoBufMediaTypeFormatter();\n\tvar request = new SearchProductRequest { Name = 'iphone', OrderBy = 'id' };\n\tvar content = new ObjectContent\u003cSearchProductRequest\u003e(request, formatter);\n\tvar response = await client.PostAsync(\"http://localhost/api/products:search\", content);\n\tvar products = await response.Content.ReadAsAsync\u003cProduct[]\u003e(new[] {formatter});\n}\n```\n\n### Installing\n\n```shell\ndotnet add package Byndyusoft.Net.Http.ProtoBuf\n```\n\n# Contributing\n\nTo contribute, you will need to setup your local environment, see [prerequisites](#prerequisites). For the contribution and workflow guide, see [package development lifecycle](#package-development-lifecycle).\n\nA detailed overview on how to contribute can be found in the [contributing guide](CONTRIBUTING.md).\n\n## Prerequisites\n\nMake sure you have installed all of the following prerequisites on your development machine:\n\n- Git - [Download \u0026 Install Git](https://git-scm.com/downloads). OSX and Linux machines typically have this already installed.\n- .NET Core (version 3.1 or higher) - [Download \u0026 Install .NET Core](https://dotnet.microsoft.com/download/dotnet-core/3.1).\n\n## General folders layout\n\n### src\n- source code\n\n### tests\n\n- unit-tests\n\n## Package development lifecycle\n\n- Implement package logic in `src`\n- Add or addapt unit-tests (prefer before and simultaneously with coding) in `tests`\n- Add or change the documentation as needed\n- Open pull request in the correct branch. Target the project's `master` branch\n\n# Maintainers\n\n[github.maintain@byndyusoft.com](mailto:github.maintain@byndyusoft.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyndyusoft%2Fbyndyusoft.net.http.protobuf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyndyusoft%2Fbyndyusoft.net.http.protobuf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyndyusoft%2Fbyndyusoft.net.http.protobuf/lists"}