{"id":20535047,"url":"https://github.com/jhuntdev/blest-dotnet","last_synced_at":"2026-02-03T15:30:59.718Z","repository":{"id":178085667,"uuid":"657789629","full_name":"jhuntdev/blest-dotnet","owner":"jhuntdev","description":"The .NET reference implementation of BLEST (Batch-able, Lightweight, Encrypted State Transfer), an improved communication protocol for web APIs which leverages JSON, supports request batching by default, and provides a modern alternative to REST.","archived":false,"fork":false,"pushed_at":"2024-10-28T08:47:15.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-01T01:25:30.209Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/jhuntdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2023-06-23T21:25:31.000Z","updated_at":"2024-10-28T08:47:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"15118431-66b0-4d7f-b825-37538547f908","html_url":"https://github.com/jhuntdev/blest-dotnet","commit_stats":null,"previous_names":["jhuntdev/blest-dotnet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jhuntdev/blest-dotnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fblest-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fblest-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fblest-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fblest-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhuntdev","download_url":"https://codeload.github.com/jhuntdev/blest-dotnet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fblest-dotnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29047857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T15:19:55.533Z","status":"ssl_error","status_checked_at":"2026-02-03T15:13:09.723Z","response_time":96,"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":[],"created_at":"2024-11-16T00:29:07.813Z","updated_at":"2026-02-03T15:30:59.698Z","avatar_url":"https://github.com/jhuntdev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BLEST .NET\n\nThe .NET reference implementation of BLEST (Batch-able, Lightweight, Encrypted State Transfer), an improved communication protocol for web APIs which leverages JSON, supports request batching by default, and provides a modern alternative to REST.\n\nTo learn more about BLEST, please visit the website: https://blest.jhunt.dev\n\nFor a front-end implementation in React, please visit https://github.com/jhuntdev/blest-react\n\n## Features\n\n- Built on JSON - Reduce parsing time and overhead\n- Request Batching - Save bandwidth and reduce load times\n- Compact Payloads - Save even more bandwidth\n- Single Endpoint - Reduce complexity and facilitate introspection\n- Fully Encrypted - Improve data privacy\n\n## Installation\n\nInstall BLEST .NET from NuGet\n\n```bash\ndotnet add package Blest\n```\n\n## Usage\n\nThe `Blest` class of this library has an interface similar to ASP.NET Core. It also provides a `Router` class with a `Handle` method for use in an existing .NET API and an `HttpClient` class with a `Request` method for making BLEST HTTP requests.\n\n```c#\nusing System;\nusing System.Threading.Tasks;\nusing System.Collections.Generic;\nusing Blest;\n\n// Instantiate your app\nvar app = new Blest({ \"timeout\": 1000, \"cors\": true });\n\n// Create some middleware (optional)\napp.Use(async (body, context) =\u003e\n{\n  if (context.ContainsKey(\"headers\") \u0026\u0026 context[\"headers\"][\"auth\"] === \"myToken\")\n  {\n    context[\"user\"] = new Dictionary\u003cstring, object?\u003e\n    {\n      // user info for example\n    };\n  }\n  else\n  {\n    throw new Exception(\"Unauthorized\");\n  }\n});\n\n// Create a route controller\napp.Map('greet', async (body, context) =\u003e\n{\n  return new Dictionary\u003cstring, object?\u003e\n  {\n    { \"greeting\", \"Hi, \" + body[\"name\"] + \"!\" }\n  };\n});\n\n// Start your BLEST server\napp.Run();\n```\n\n### Router\n\n```c#\nusing System;\nusing System.Threading.Tasks;\nusing System.Collections.Generic;\nusing Blest;\n\n// Instantiate your Router\nvar router = new Router({ \"timeout\": 1000 });\n\n// Create some middleware (optional)\nrouter.Use(async (body, context) =\u003e\n{\n  if (context.ContainsKey(\"headers\") \u0026\u0026 context[\"headers\"][\"auth\"] === \"myToken\")\n  {\n    context[\"user\"] = new Dictionary\u003cstring, object?\u003e\n    {\n      // user info for example\n    };\n  }\n  else\n  {\n    throw new Exception(\"Unauthorized\");\n  }\n});\n\n// Create a route controller\nrouter.Map('greet', async (body, context) =\u003e\n{\n  return new Dictionary\u003cstring, object?\u003e\n  {\n    { \"greeting\", \"Hi, \" + ((Dictionary\u003cstring, object?\u003e)context[\"user\"])[\"name\"] + \"!\" }\n  };\n});\n\n// ...later in your application\n// Handle a request\nresult, error = router.Handle(jsonData, context);\nif (error is not null)\n{\n  // do something in case of error\n}\nelse\n{\n  // do something with the result\n}\n```\n\n### HttpClient\n\n```c#\nusing System;\nusing System.Net.Http;\nusing System.Net.Http.Headers;\nusing System.Threading.Tasks;\nusing Blest;\n\nclass Program\n{\n  static async Task Main()\n  {\n    // Create a client\n    Dictionary\u003cstring, object?\u003e options = new Dictionary\u003cstring, object?\u003e\n    {\n      [\"httpHeaders\"] = new Dictionary\u003cstring, object?\u003e\n      {\n        [\"Authorization\"] = \"Bearer token\"\n      }\n    };\n    var client = new HttpClient(\"http://localhost:8080\", options);\n\n    try\n    {\n      // Send a request\n      IDictionary\u003cstring, object?\u003e body = new Dictionary\u003cstring, object?\u003e {\n          { \"name\", \"Steve\" }\n      };\n      IDictionary\u003cstring, object?\u003e headers = new Dictionary\u003cstring, object?\u003e {\n          { \"auth\", \"myToken\" }\n      };\n      var result = await client.Request(\"greet\", body, headers);\n      // Do something with the result\n    }\n    catch (Exception error)\n    {\n      // Do something in case of error\n    }\n  }\n}\n```\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhuntdev%2Fblest-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhuntdev%2Fblest-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhuntdev%2Fblest-dotnet/lists"}