Exemplo n.º 1
0
 public void Get(HttpResponseMessage resp, WebLinkCollection linkCollection)
 {
     resp.StatusCode = HttpStatusCode.NoContent;
 }
Exemplo n.º 2
0
 public string Get(HttpResponseMessage resp, WebLinkCollection webLinks)
 {
     webLinks.Links.Add(new WebLinkTarget(null, "http://someuri", "next"));
     resp.StatusCode = HttpStatusCode.OK;
     return "done";
 }
        private static void addLinkHeader(HttpResponseMessage httpResponse, WebLinkCollection linkCollection)
        {
            var links = linkCollection
                .Links
                .Aggregate(new StringBuilder(), (b, target) => b.Append(extractLinkDescription(target)).Append(','))
                .RemoveLastCharacter()
                .ToString();

            if (links.IsNullOrEmpty() == false)
            {
                httpResponse.Headers.AddWithoutValidation("Link", links);
            }
        }