Example #1
0
 public InMemoryRequest()
 {
     Headers = new HttpHeaderDictionary();
     Headers.Add("Host", "http://localhost/");
     Entity          = new HttpEntity(Headers, new MemoryStream());
     CodecParameters = new List <string>();
 }
        public void op_Contains_Token()
        {
            var obj = new HttpHeaderDictionary();

            Assert.False(obj.Contains("name"));

            obj.Add(new HttpHeader("name", "value"));

            Assert.True(obj.Contains("name"));
        }
Example #3
0
        void PopulateHeaders(IOwinRequest ctx)
        {
            var headerCollection = new HttpHeaderDictionary();

            foreach (var header in ctx.Headers)
            {
                headerCollection.Add(header.Key, string.Join(",", header.Value));
            }

            Headers = headerCollection;
        }
Example #4
0
 public void add_once()
 {
     headers.Add("key", "value");
     headers.ShouldHaveHeaderValues("key", "value");
 }
Example #5
0
 public void adding_header()
 {
     headers.Add("content-length", "42");
     headers.ContentLength.ShouldBe(42);
 }