using System; using System.IO; namespace BlogServer.WebServer { public class Request { private readonly string _httpMethod; private readonly string _path; private readonly string _querystring; private readonly HttpHeaders _headers; private readonly Stream _requestBody; public Request(string httpMethod, string path, string querystring, HttpHeaders headers, Stream requestBody) { _httpMethod = httpMethod; _path = path; _querystring = querystring; _headers = headers; _requestBody = requestBody; } /// /// "GET", "POST", etc. /// public string HttpMethod { get { return _httpMethod; } } /// /// e.g. "/", "/foo/bar.png" /// public string Path { get { return _path; } } /// /// e.g. "foo=bar&x=y" /// public string Querystring { get { return _querystring; } } public HttpHeaders Headers { get { return _headers; } } /// /// The data in the body of the request (does not include headers). /// public Stream RequestBody { get { return _requestBody; } } } }