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())); }
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); }
public override string ToString() { var sb = new StringBuilder(); sb.AppendLine(Line.ToString()); foreach (var header in Headers) { sb.AppendLine(header.ToString()); } return(sb.ToString()); }
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()); }