コード例 #1
0
 public void Get(HttpResponseMessage resp, WebLinkCollection linkCollection)
 {
     resp.StatusCode = HttpStatusCode.NoContent;
 }
コード例 #2
0
 public string Get(HttpResponseMessage resp, WebLinkCollection webLinks)
 {
     webLinks.Links.Add(new WebLinkTarget(null, "http://someuri", "next"));
     resp.StatusCode = HttpStatusCode.OK;
     return "done";
 }
コード例 #3
0
        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);
            }
        }