Getting Started
Getting Started
Installation
dotnet add package Glyph11Targets .NET 10.0. No external dependencies.
Quick Start
### Add the NuGet package
```bash
dotnet add package Glyph11
```
### Parse a request
```csharp
using System.Buffers;
using Glyph11.Protocol;
using Glyph11.Parser.Hardened;
ReadOnlySequence buffer = ...; // from PipeReader, Socket, etc.
var request = new BinaryRequest();
var limits = ParserLimits.Default;
if (HardenedParser.TryExtractFullHeader(ref buffer, request, in limits, out int bytesRead))
{
// request.Method, request.Path, request.Headers, request.QueryParameters
// are all populated as ReadOnlyMemory slices into the original buffer.
// Advance your reader by bytesRead.
}
```
### Dispose when done
```csharp
// When done, dispose to return pooled arrays:
request.Dispose();
```
Since parsed fields reference the input buffer, the buffer must remain valid for as long as you access the request data. If you need the data to outlive the buffer, copy it (e.g.
request.Method.ToArray()).Next Steps
- PipeReader integration example for a complete server loop
- Architecture overview to understand the parsing paths
- HardenedParser for validation rules and limits