예제 #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"));
        }
예제 #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;
        }
예제 #4
0
 public void add_once()
 {
     headers.Add("key", "value");
     headers.ShouldHaveHeaderValues("key", "value");
 }
예제 #5
0
 public void adding_header()
 {
     headers.Add("content-length", "42");
     headers.ContentLength.ShouldBe(42);
 }