public MemoryStream MakeRequestLineAndHeadersStream(string postpend)
        {
            Message.HostHeader hostHeader;

            hostHeader = new Message.HostHeader(this.RequestLine.RequestUri.Host);
            Headers[hostHeader.Name] = hostHeader.Value;

            if (RequestLine.Method.GetType() == typeof(Http.Methods.Get))
            {
            }
            else if (RequestLine.Method.GetType() == typeof(Http.Methods.Delete))
            {
            }
            else if (RequestLine.Method.GetType() == typeof(Http.Methods.Head))
            {
            }
            else
            {
                // Currently not supporting sending of chunked content
                if (ContentLength == null)
                {
                    throw new Message.HeaderException("Content-Length header is null");
                }
            }

            return(new MemoryStream(System.Text.Encoding.ASCII.GetBytes(RequestLine.ToString() + "\r\n" + Headers.ToString() + "\r\n" + postpend)));
        }
Example #2
0
        public MemoryStream MakeRequestLineAndHeadersStream(string postpend)
        {
            Message.HostHeader hostHeader;

            hostHeader = new Message.HostHeader(this.RequestLine.RequestUri.Host);
            Headers[hostHeader.Name] = hostHeader.Value;

            if (RequestLine.Method.GetType() == typeof(Http.Methods.Get))
            {

            }
            else if (RequestLine.Method.GetType() == typeof(Http.Methods.Delete))
            {

            }
            else if (RequestLine.Method.GetType() == typeof(Http.Methods.Head))
            {

            }
            else
            {
                // Currently not supporting sending of chunked content
                if (ContentLength == null)
                    throw new Message.HeaderException("Content-Length header is null");
            }

            return new MemoryStream(System.Text.Encoding.ASCII.GetBytes(RequestLine.ToString() + "\r\n" + Headers.ToString() + "\r\n" + postpend));
        }