I need something quite different from question with similar subject.
I'm wondering if exist a .NET library that creates a real http request stream (obviously in parametric way). This is not for ASP.NET or other web framework, I want a raw stream of bytes (not mock objects of various http contexts).
I have intentionally omitted fake from the question title, because I need a real http request but I do not want a component that sent it over the network.
[note by ebohlman]: If I read you correctly, a clearer way of putting it is "... creates a simulated http request stream (at the raw-byte level) based on supplied parameters ..."
Basically I should be able to (it follows pseudo-C#):
[Fact]
void Parse_http_request_headers() {
HttpRequest req = HttpRequestBuilder.Create(HttpMethod.Get, "http://someserver/app/etc/etc");
HttpParser parser = new HttpParser(req.ToByteArray());
parser.Method.Should().Be("GET");
parser.Scheme.Should().Be("http");
// Remainder omitted
}
I just want to know if someone already created something like this.