Beispiel #1
0
        public void ComposeHttpRequest()
        {
            _formatter.AppendHttpRequestLine(HttpMethod.Get, HttpVersion.V1_1, "/path");

            _formatter.AppendHttpHeader("header1:", "header_value1");
            _formatter.AppendHttpHeader("header2:", "header_value2");
            _formatter.AppendHttpHeader("x-ms-date:", new DateTime(2017, 8, 15, 1, 2, 3, 4));
            _formatter.AppendHttpHeader("header3:", 3456);
            _formatter.AppendHttpNewLine();

            var result = _formatter.Formatted;
            var text   = Encoding.UTF8.GetString(result.ToArray());

            Assert.Equal(s_expectedRequest, text);
            _formatter.Clear();
        }