예제 #1
0
        public static void AddLinkHeader(this HttpHeaders headers, Link link)
        {
            var headerValue = link.AsLinkHeader();

            headers.Add("Link", headerValue);
        }
 public static void AddLinkHeader(this HttpHeaders headers, Link link )
 {
     var headerValue = link.AsLinkHeader();
     headers.Add("Link", headerValue);
 }
예제 #3
0
 public void CreateLinkHeaderWithRelation()
 {
     var link = new Link() { Target = new Uri("http://localhost/{?foo}"),
         Relation = "related",
         Title = "foo"
     };
     Assert.Equal("<http://localhost/{?foo}>;rel=\"related\";title=\"foo\"", link.AsLinkHeader());
 }
예제 #4
0
 public void CreateLinkHeaderWithMediaTypeAndLanguages()
 {
     var link = new Link()
     {
         Target = new Uri("http://localhost/{?foo}"),
         Type = "application/foo"
     };
     link.HrefLang.Add(new CultureInfo("en-GB"));
     link.HrefLang.Add(new CultureInfo("en-CA"));
     Assert.Equal("<http://localhost/{?foo}>;rel=\"related\";hreflang=en-GB;hreflang=en-CA;type=\"application/foo\"", link.AsLinkHeader());
 }
예제 #5
0
 public void CreateLinkHeader()
 {
     var link = new Link() { Target = new Uri("http://localhost/{?foo}") };
     Assert.Equal("<http://localhost/{?foo}>;rel=\"related\"", link.AsLinkHeader());
 }