![]() |
VOOZH | about |
dotnet add package GenHTTP.Modules.IO --version 10.5.3
NuGet\Install-Package GenHTTP.Modules.IO -Version 10.5.3
<PackageReference Include="GenHTTP.Modules.IO" Version="10.5.3" />
<PackageVersion Include="GenHTTP.Modules.IO" Version="10.5.3" />Directory.Packages.props
<PackageReference Include="GenHTTP.Modules.IO" />Project file
paket add GenHTTP.Modules.IO --version 10.5.3
#r "nuget: GenHTTP.Modules.IO, 10.5.3"
#:package GenHTTP.Modules.IO@10.5.3
#addin nuget:?package=GenHTTP.Modules.IO&version=10.5.3Install as a Cake Addin
#tool nuget:?package=GenHTTP.Modules.IO&version=10.5.3Install as a Cake Tool
Provides I/O related functionality to be used within a GenHTTP application.
Access to resources such as files are abstracted in GenHTTP via IResourceTree
and IResource. The I/O module adds common implementations to load resources from
strings, files or an assembly. It also adds useful features such as virtual resource
trees or change tracking for resources.
See the documentation for more details.
Besides the resource implementations, the module adds some IResponseContent
implementations that can be used to directly set the content when building a response.
See the documentation for more details.
The following handlers and concerns are provided by this module.
Those entry points allow to quickly create concerns and handlers without the need of implementing interfaces and of providing builders.
For documentation, see the concern and handler pages.
Provides a single resource to a requesting client. In contrast to downloads,
the response is expected to be consumed by the client without actually downloading it
to a local file. The Content-Type is computed from the given resource. For named
resources, the logic will try to guess the content type from the file extension.
using GenHTTP.Engine.Internal;
using GenHTTP.Modules.IO;
using GenHTTP.Modules.Layouting;
using GenHTTP.Modules.Practices;
var content = Content.From(Resource.FromString("Hello World!"));
var app = Layout.Create()
.Add("hello", content);
await Host.Create()
.Handler(app)
.Defaults()
.Console()
.RunAsync();
The module also provides extensions
Allows clients to download a single resource and to specify the name as
it should be presented to the user. The logic tries to automatically
determine the Content-Type of the resource.
using GenHTTP.Api.Protocol;
using GenHTTP.Engine.Internal;
using GenHTTP.Modules.IO;
using GenHTTP.Modules.Layouting;
using GenHTTP.Modules.Practices;
var file = Resource.FromFile("./my.pdf");
var download = Download.From(file)
.FileName("invoice-user-1234.pdf") // optional, would be "my.pdf" otherwise
.Type(ContentType.ApplicationPdf); // optional, automatically detected here
var app = Layout.Create()
.Add("get-invoice", download);
await Host.Create()
.Handler(app)
.Defaults()
.Console()
.RunAsync();
This concern allows clients to request only a specific part of the data provided by the inner handler.
For this to work, the inner handler needs to set a Content-Length on the response. Chunked responses
are not supported. Requires the HTTP method to be GET or HEAD.
The concern will set a Accept-Ranges: bytes header to signal range support to the client.
The client can then request a specific byte range using the Range header, e.g. Range: 100- to skip
the first 100 bytes of the response.
While this concern can safely be applied to the root handler, it is recommended to apply it only to the handlers where the functionality is needed, as there is some runtime overhead for each request.
using GenHTTP.Engine.Internal;
using GenHTTP.Modules.IO;
using GenHTTP.Modules.Layouting;
using GenHTTP.Modules.Practices;
var download = Download.From(Resource.FromFile("my-large.bin"))
.AddRangeSupport();
var app = Layout.Create()
.Add("file", download);
await Host.Create()
.Handler(app)
.Defaults()
.Console()
.RunAsync();
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on GenHTTP.Modules.IO:
| Package | Downloads |
|---|---|
|
GenHTTP.Core
Basic dependencies for projects using the GenHTTP framework, including the engine itself |
|
|
GenHTTP.Modules.Pages
Allows to generate and serve HTML pages |
|
|
GenHTTP.Modules.Conversion
Allows to read and write responses in additional data formats such as JSON or XML |
|
|
GenHTTP.Modules.Practices
Best practices to configure a GenHTTP webserver instance for production |
|
|
GenHTTP.Modules.Compression
Allows to compress generated content using various algorithms. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.0-preview.18 | 189 | 6/10/2026 |
| 11.0.0-preview.17 | 184 | 6/10/2026 |
| 11.0.0-preview.16 | 194 | 6/8/2026 |
| 11.0.0-preview.15 | 195 | 6/4/2026 |
| 11.0.0-preview.14 | 182 | 6/4/2026 |
| 11.0.0-preview.13 | 191 | 6/4/2026 |
| 11.0.0-preview.12 | 188 | 6/2/2026 |
| 11.0.0-preview.11 | 195 | 5/29/2026 |
| 11.0.0-preview.10 | 199 | 5/28/2026 |
| 11.0.0-preview.9 | 218 | 5/28/2026 |
| 11.0.0-preview.8 | 188 | 5/26/2026 |
| 11.0.0-preview.7 | 197 | 5/19/2026 |
| 11.0.0-preview.6 | 86 | 3/9/2026 |
| 11.0.0-preview.5 | 88 | 3/9/2026 |
| 11.0.0-preview.4 | 71 | 3/7/2026 |
| 11.0.0-preview.3 | 68 | 3/7/2026 |
| 11.0.0-preview.2 | 82 | 3/6/2026 |
| 10.5.3 | 1,085 | 5/2/2026 |
| 10.5.2 | 1,215 | 4/30/2026 |
| 10.5.1 | 780 | 4/27/2026 |