This project is read-only.
Easy to use, one method based, asynchronous HTTP request/response parser. It contains also a synchronous version; none of versions wraps the other, there are two independent implementations.

At glance
Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(
  "GET /gsscoder/httphelpers HTTP/1.1\r\n" +
  "Content-Type: text/html; q=0.9, text/plain\r\n\r\n"));

bool result = await HttpParser.ParseMessageAsync(stream, (method, uri, version) =>
  (header, value) => 
    Debug.WriteLine(header + " " + value);

// When parsing a response, just name heading-line lambda parameters:
// version, code and reason.
// For the body: just read remaining bytes from the stream.

NET 4.0
  • Pull-in sources with NuGet (or manually if you prefer).
  • Uncomment NO_ASYNC_API compilation symbol in HttpParser.cs.

  • CodePlex (package download): alfa.
  • GitHub (source repository): alfa.
  • NuGet (source package): alfa.

  • The project contains a sample HTTP server, for quick reference available here.
  • You can check also this project, a simple Owin HTTP listener (work in progress).


Last edited Feb 16, 2013 at 9:19 PM by gsscoder, version 23