{"id":16482204,"url":"https://github.com/cajuncoding/flurlasyncenumerablestreaming","last_synced_at":"2026-01-19T04:32:14.149Z","repository":{"id":248983706,"uuid":"830378699","full_name":"cajuncoding/FlurlAsyncEnumerableStreaming","owner":"cajuncoding","description":"Async Enumerable Byte Streaming extensions for Flurl.Http -- lightweight, simplified, asynchronous, fluent support for streaming byte array results from Http requests using the amazing Flurl Http library!","archived":false,"fork":false,"pushed_at":"2024-08-08T21:59:21.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T09:23:52.614Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/cajuncoding.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":"2024-07-18T06:52:44.000Z","updated_at":"2024-08-08T21:59:24.000Z","dependencies_parsed_at":"2024-07-18T08:50:02.102Z","dependency_job_id":"15525b66-6071-4f2e-b445-398112f4fac9","html_url":"https://github.com/cajuncoding/FlurlAsyncEnumerableStreaming","commit_stats":null,"previous_names":["cajuncoding/flurlasyncenumerablestreaming"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cajuncoding/FlurlAsyncEnumerableStreaming","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cajuncoding%2FFlurlAsyncEnumerableStreaming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cajuncoding%2FFlurlAsyncEnumerableStreaming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cajuncoding%2FFlurlAsyncEnumerableStreaming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cajuncoding%2FFlurlAsyncEnumerableStreaming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cajuncoding","download_url":"https://codeload.github.com/cajuncoding/FlurlAsyncEnumerableStreaming/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cajuncoding%2FFlurlAsyncEnumerableStreaming/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28561840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T03:31:16.861Z","status":"ssl_error","status_checked_at":"2026-01-19T03:31:15.069Z","response_time":67,"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-10-11T13:10:00.239Z","updated_at":"2026-01-19T04:32:14.123Z","avatar_url":"https://github.com/cajuncoding.png","language":"C#","readme":"﻿# FlurlAsyncEnumerableStreaming\n## Overview\nA set of lightweight and easy to use Async Enumerable Byte Streaming extensions for Flurl.Http.\n\nThis provides a streamlined wasy to stream binary data for Http web requests in a lightweight, simplified, asynchronous, fluent manner using the amazing Flurl Http library!\n\nThe key benefit here is that you can stream the binary data of any Http Reqeust efficiently without having to buffer the entire stream/response into memory before\ndirecting it to it's proper destination. Using `AsyncEnumerable` you are able to decouple and greatly simplify/streamline your logic from the \ncomplexities of the streaming process.\n\n### Give Star 🌟\n**If you like this project and/or use it the please give it a Star 🌟 (c'mon it's free, and it'll help others find the project)!**\n\n### [Buy me a Coffee ☕](https://www.buymeacoffee.com/cajuncoding)\n*I'm happy to share with the community, but if you find this useful (e.g for professional use), and are so inclinded,\nthen I do love-me-some-coffee!*\n\n\u003ca href=\"https://www.buymeacoffee.com/cajuncoding\" target=\"_blank\"\u003e\n\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\n\u003c/a\u003e \n\n## Usage\nUsing any valid HTTP request url with `Flurl.Http`, you can call the extension method `GetStreamAsAsyncEnumerable()` provided which\nreturns a `FlurlAsyncEnumerableByteStream` that implements `IAsyncEnumerable\u003cbyte\u003e` \u0026 `IAsyncDisposable`. \n\nIt also provides a helper method `GetHeadersAsync()`\nwhich is often needed to access details such as content headers (e.g. Content-Type, Content-Length) very often needed for\nbinary file streaming.\n\nIn general, you will use `await foreach(...)` to enumerate the async stream which will automatically dispose of it,\nensuring that all resources, including the IFlurlResposne, are all properly disposed of.  However, if you do not enumerate it then you should\nexplicitly dispose of the `FlurlAsyncEnumerableByteStream`.\n\nIn addition, the `FlurlAsyncEnumerableByteStream` is re-entrant and can be safely enumerated multiple times -- even after disposal which can help simplify complex code flows.\nIt will lazily re-initialize the Http Response as needed and can be disposed of safely again; usually automatically by the `await forech(...)` process.\n\n### Simple Example\n```csharp\n\n//A valid Url to a Binary file you want to stream using Flurl.Http...\nvar downloadUrl = \"https://www.dropbox.com/abc/de/Your_Test_File.mov?raw=1\";\n\n//A local or remote streaming destination... here we use the FileSystem...\nvar tempDirectory = \"D:\\Your_Temp_Directory\";\nvar fileInfo = new FileInfo(Path.Combine(tempDirectory, Path.GetFileName(downloadUrl.Path)));\nif (fileInfo.Exists) fileInfo.Delete();\n\nawait using (var fileStream = fileInfo.OpenWrite())\n{\n    //Now we can easily iterate over all binary bytes by streaming in chunks...\n    //NOTE: GetStreamAsAsyncEnumerable() is the Flurl Extension provided by this library...\n    await foreach (var byteChunk in downloadUrl.GetStreamAsAsyncEnumerable())\n    {\n        await fileStream.WriteAsync(byteChunk);\n    }\n}\n\n//Now you've finished efficiently streaming without having to buffer the entire binary/stream into Memory!\nProcess.Start(\"explorer.exe\", $\"/open, \\\"{tempDirectory}\\\"\");\n```\n\n## Accessing Content Headers (e.g. Content-Type, Content-Length, etc.)\n```csharp\n\n//A valid Url to a Binary file you want to stream using Flurl.Http...\nvar downloadUrl = \"https://www.dropbox.com/abc/de/Your_Test_File.mov?raw=1\"\n\nawait using var asyncEnumerableStream = downloadUrl.GetStreamAsAsyncEnumerable();\nvar contentHeaders = await asyncEnumerableStream.GetHeadersAsync();\n\n//Access any Content Headers from the Properties provided...\nConsole.WriteLine($\"Content-Type = [{contentHeaders.ContentType}]\");\n\n//NOTE: ContentLength is already parsed/converted to strongly typed Long...\nConsole.WriteLine($\"Content-Length = [{contentHeaders.ContentLength}]\");\n\n//Or lookup any Header you like via string name (if availalbe in the response)...\nvar lastModified = contentHeaders.HeadersLookup[\"Last-Modified\"].FirstOrDefault();\n\n//Or use some of the known Content Header constants provided...\nvar md5 = contentHeaders.HeadersLookup[KnownHttpResponseContentHeaderNames.ContentMD5].FirstOrDefault();\n\n```\n\n\n\n","funding_links":["https://www.buymeacoffee.com/cajuncoding"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcajuncoding%2Fflurlasyncenumerablestreaming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcajuncoding%2Fflurlasyncenumerablestreaming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcajuncoding%2Fflurlasyncenumerablestreaming/lists"}