Пример #1
0
        public static IList <Link> ParseLinkHeader(this Link link, string linkHeader, LinkFactory linkRegistry)
        {
            var parser = new LinkHeaderParser(linkRegistry);

            return(parser.Parse(link.Target, linkHeader));
        }
Пример #2
0
 public static List <Link> ParseLinkHeaders(this HttpResponseMessage responseMessage, LinkFactory linkRegistry)
 {
     return(ParseLinkHeaders(responseMessage.Headers, responseMessage.RequestMessage.RequestUri, linkRegistry));
 }
Пример #3
0
        public static List <Link> ParseLinkHeaders(this HttpHeaders headers, Uri baseUri, LinkFactory linkRegistry)
        {
            var list        = new List <Link>();
            var parser      = new LinkHeaderParser(linkRegistry);
            var linkHeaders = headers.GetValues("Link");

            foreach (var linkHeader in linkHeaders)
            {
                list.AddRange(parser.Parse(baseUri, linkHeader));
            }
            return(list);
        }
Пример #4
0
 public LinkHeaderParser(LinkFactory linkFactory)
 {
     _linkFactory = linkFactory;
 }