/// <summary>
 /// Returns the type of this message
 /// </summary>
 public static HttpMessageTypes TypeOf(string firstLine)
 {
     try
     {
         // requests are more common so we'll try that first
         HttpRequestLine requestLine = HttpRequestLine.Parse(firstLine);
         return(HttpMessageTypes.HttpRequest);
     }
     catch
     {
         try
         {
             // followed closely by responses
             HttpStatusLine statusLine = HttpStatusLine.Parse(firstLine);
             return(HttpMessageTypes.HttpResponse);
         }
         catch
         {
             // hmmm, it somehow was parsed into a message but we can't figure out what the hell it is
             // so we're going to say it's an unknown type
             return(HttpMessageTypes.Unknown);
         }
     }
 }
		/// <summary>
		/// Initializes a new instance of the HttpRequest class
		/// </summary>
		/// <param name="message">The incoming message that will construct this request</param>
		public HttpRequest(HttpMessage message) : base(message)
		{
			_requestLine = HttpRequestLine.Parse(base.FirstLine);
		}
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the HttpRequest class
 /// </summary>
 /// <param name="message">The incoming message that will construct this request</param>
 public HttpRequest(HttpMessage message) : base(message)
 {
     _requestLine = HttpRequestLine.Parse(base.FirstLine);
 }
		/// <summary>
		/// Initializes a new instance of the HttpRequest class
		/// </summary>
		public HttpRequest() : base()
		{
			_requestLine = new HttpRequestLine();
			this.InitHeaders();
		}
Esempio n. 5
0
 /// <summary>
 /// Initializes a new instance of the HttpRequest class
 /// </summary>
 public HttpRequest() : base()
 {
     _requestLine = new HttpRequestLine();
     this.InitHeaders();
 }