Example #1
0
 public override byte[] GetHeader(params HttpHeader[] rewrites)
 {
     sb.Clear();
     sb.Append(RequestLine.ToString());
     HeaderList.Format(sb, rewrites);
     sb.Append("\r\n");
     return(Encoding.GetBytes(sb.ToString()));
 }
Example #2
0
        public void ToStringTest(string method, string protocol, string version, string result)
        {
            var instance = new RequestLine {
                Method = method, Protocol = protocol, Version = version
            };

            Assert.Equal(instance.ToString(), result);
            Assert.Equal($"{instance}", result);
        }
Example #3
0
            public override string ToString()
            {
                var sb = new StringBuilder();

                sb.AppendLine(Line.ToString());

                foreach (var header in Headers)
                {
                    sb.AppendLine(header.ToString());
                }

                return(sb.ToString());
            }
Example #4
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(RequestLine.ToString());
            sb.Append(Header.ToString());

            if (Body != null)
            {
                sb.AppendLine();
                sb.Append(Body.ToString());
            }

            return(sb.ToString());
        }