Skip to content

modulexcite/httphelpers

 
 

Repository files navigation

Http Helpers 0.1.6.0 alfa.

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.

NuGet: Install-Package HttpHelpers.Sources -Pre

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) =>
  {
    Debug.WriteLine(method);
    Debug.WriteLine(uri);
    Debug.WriteLine(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.

News:

  • Increased tests coverage.
  • Fixed an issue with NO_ASYNC_API compilation symbol.

Resources:

Contacts:

Giacomo Stelluti Scala

About

HTTP Helpers for C# / .NET

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 97.0%
  • Ruby 3.0%