{"action":"created","comment":{"url":"https://api.github.com/repos/NancyFx/Nancy/pulls/comments/58299486","id":58299486,"diff_hunk":"@@ -0,0 +1,262 @@\n+namespace Nancy\n+{\n+    using System;\n+    using System.Collections.Generic;\n+    using System.Linq;\n+    using System.Text;\n+    using Nancy.Responses.Negotiation;\n+\n+    /// <summary>\n+    /// Represents one of possibly many RFC 5899 HTTP Links contained in a <see cref=\"HttpLinkBuilder\"/>.\n+    /// </summary>\n+    public class HttpLink : Dictionary<string, object>, IEquatable<HttpLink>\n+    {\n+        private readonly Uri targetUri;\n+\n+        /// <summary>\n+        /// Initializes a new instance of the <see cref=\"HttpLink\" /> class.\n+        /// </summary>\n+        /// <param name=\"targetUri\">The target URI of the link.</param>\n+        /// <param name=\"relation\">The relation that identifies the semantics of the link.</param>\n+        /// <exception cref=\"System.ArgumentNullException\"><paramref name=\"targetUri\" /> or <paramref name=\"relation\" /></exception>\n+        public HttpLink(string targetUri, string relation)\n+            : this(ParseUri(targetUri), relation, string.Empty, string.Empty)\n+        {\n+        }\n+\n+        /// <summary>\n+        /// Initializes a new instance of the <see cref=\"HttpLink\" /> class.\n+        /// </summary>\n+        /// <param name=\"targetUri\">The target URI of the link.</param>\n+        /// <param name=\"relation\">The relation that identifies the semantics of the link.</param>\n+        /// <param name=\"type\">The optional type parameter is a hint indicating what the media type of the result of dereferencing the link should be. Note that this is only a hint; for example, it does not override the HTTP Content-Type header of a HTTP response obtained by actually following the link.</param>\n+        /// <exception cref=\"System.ArgumentNullException\"><paramref name=\"targetUri\" /> or <paramref name=\"relation\" /></exception>\n+        public HttpLink(string targetUri, string relation, string type)\n+            : this(ParseUri(targetUri), relation, type, string.Empty)\n+        {\n+        }\n+\n+        /// <summary>\n+        /// Initializes a new instance of the <see cref=\"HttpLink\" /> class.\n+        /// </summary>\n+        /// <param name=\"targetUri\">The target URI of the link.</param>\n+        /// <param name=\"relation\">The relation that identifies the semantics of the link.</param>\n+        /// <param name=\"type\">The optional type parameter is a hint indicating what the media type of the result of dereferencing the link should be. Note that this is only a hint; for example, it does not override the HTTP Content-Type header of a HTTP response obtained by actually following the link.</param>\n+        /// <param name=\"title\">The optional title parameter is used to label the destination of a link such that it can be used as a human-readable identifier (e.g., a menu entry) in the language indicated by the HTTP Content-Language header (if present).</param>\n+        /// <exception cref=\"System.ArgumentNullException\"><paramref name=\"targetUri\" /> or <paramref name=\"relation\" /></exception>\n+        public HttpLink(string targetUri, string relation, string type, string title)\n+            : this(ParseUri(targetUri), relation, type, title)\n+        {\n+        }\n+\n+        /// <summary>\n+        /// Initializes a new instance of the <see cref=\"HttpLink\" /> class.\n+        /// </summary>\n+        /// <param name=\"targetUri\">The target URI of the link.</param>\n+        /// <param name=\"relation\">The relation that identifies the semantics of the link.</param>\n+        /// <param name=\"type\">The optional type parameter is a hint indicating what the media type of the result of dereferencing the link should be. Note that this is only a hint; for example, it does not override the HTTP Content-Type header of a HTTP response obtained by actually following the link.</param>\n+        /// <param name=\"title\">The optional title parameter is used to label the destination of a link such that it can be used as a human-readable identifier (e.g., a menu entry) in the language indicated by the HTTP Content-Language header (if present).</param>\n+        /// <exception cref=\"System.ArgumentNullException\"><paramref name=\"targetUri\" /> or <paramref name=\"relation\" /></exception>\n+        public HttpLink(Uri targetUri, string relation, string type, string title)\n+        {\n+            if (targetUri == null)\n+            {\n+                throw new ArgumentNullException(\"targetUri\");\n+            }\n+\n+            if (relation == null)\n+            {\n+                throw new ArgumentNullException(\"relation\");\n+            }\n+\n+            this.Add(\"rel\", HttpLinkRelation.Parse(relation));\n+            this.targetUri = targetUri;\n+\n+            if (!string.IsNullOrWhiteSpace(type))\n+            {\n+                this.Add(\"type\", new MediaRange(type));\n+            }\n+\n+            if (!string.IsNullOrEmpty(title))\n+            {\n+                this.Add(\"title\", title);\n+            }\n+        }\n+\n+        /// <summary>\n+        /// The relation that identifies the semantics of the link.\n+        /// </summary>\n+        public HttpLinkRelation Relation\n+        {\n+            get { return this.GetParamValue<HttpLinkRelation>(\"rel\"); }\n+        }\n+\n+        /// <summary>\n+        /// Gets the target URI.\n+        /// </summary>\n+        public Uri TargetUri\n+        {\n+            get { return this.targetUri; }\n+        }\n+\n+        /// <summary>\n+        /// The optional title parameter is used to label the destination of a link such that it can be used as a human-readable identifier (e.g., a menu entry) in the language indicated by the HTTP Content-Language header (if present).\n+        /// </summary>\n+        public string Title\n+        {\n+            get { return this.GetParamValue<string>(\"title\"); }\n+        }\n+\n+        /// <summary>\n+        /// The optional type parameter is a hint indicating what the media type of the result of dereferencing the link should be. Note that this is only a hint; for example, it does not override the HTTP Content-Type header of a HTTP response obtained by actually following the link.\n+        /// </summary>\n+        public MediaRange Type\n+        {\n+            get { return this.GetParamValue<MediaRange>(\"type\"); }\n+        }\n+\n+        /// <summary>\n+        /// Indicates whether the current object is equal to another object of the same type.\n+        /// </summary>\n+        /// <param name=\"other\">An object to compare with this object.</param>\n+        /// <returns>\n+        /// true if the current object is equal to the <paramref name=\"other\" /> parameter; otherwise, false.\n+        /// </returns>\n+        bool IEquatable<HttpLink>.Equals(HttpLink other)","path":"src/Nancy/HttpLink.cs","position":125,"original_position":125,"commit_id":"0b5499a568325dbe0eba741e27d5a2191dbaeb32","original_commit_id":"0b5499a568325dbe0eba741e27d5a2191dbaeb32","user":{"login":"khellang","id":582487,"avatar_url":"https://avatars.githubusercontent.com/u/582487?v=3","gravatar_id":"","url":"https://api.github.com/users/khellang","html_url":"https://github.com/khellang","followers_url":"https://api.github.com/users/khellang/followers","following_url":"https://api.github.com/users/khellang/following{/other_user}","gists_url":"https://api.github.com/users/khellang/gists{/gist_id}","starred_url":"https://api.github.com/users/khellang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khellang/subscriptions","organizations_url":"https://api.github.com/users/khellang/orgs","repos_url":"https://api.github.com/users/khellang/repos","events_url":"https://api.github.com/users/khellang/events{/privacy}","received_events_url":"https://api.github.com/users/khellang/received_events","type":"User","site_admin":false},"body":"But this is the one you'd most likely want to call?","created_at":"2016-04-02T20:33:00Z","updated_at":"2016-04-02T20:33:00Z","html_url":"https://github.com/NancyFx/Nancy/pull/2389#discussion_r58299486","pull_request_url":"https://api.github.com/repos/NancyFx/Nancy/pulls/2389","_links":{"self":{"href":"https://api.github.com/repos/NancyFx/Nancy/pulls/comments/58299486"},"html":{"href":"https://github.com/NancyFx/Nancy/pull/2389#discussion_r58299486"},"pull_request":{"href":"https://api.github.com/repos/NancyFx/Nancy/pulls/2389"}}},"pull_request":{"url":"https://api.github.com/repos/NancyFx/Nancy/pulls/2389","id":64455539,"html_url":"https://github.com/NancyFx/Nancy/pull/2389","diff_url":"https://github.com/NancyFx/Nancy/pull/2389.diff","patch_url":"https://github.com/NancyFx/Nancy/pull/2389.patch","issue_url":"https://api.github.com/repos/NancyFx/Nancy/issues/2389","number":2389,"state":"open","locked":false,"title":"RFC 5899 HTTP Link builder","user":{"login":"asbjornu","id":12283,"avatar_url":"https://avatars.githubusercontent.com/u/12283?v=3","gravatar_id":"","url":"https://api.github.com/users/asbjornu","html_url":"https://github.com/asbjornu","followers_url":"https://api.github.com/users/asbjornu/followers","following_url":"https://api.github.com/users/asbjornu/following{/other_user}","gists_url":"https://api.github.com/users/asbjornu/gists{/gist_id}","starred_url":"https://api.github.com/users/asbjornu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asbjornu/subscriptions","organizations_url":"https://api.github.com/users/asbjornu/orgs","repos_url":"https://api.github.com/users/asbjornu/repos","events_url":"https://api.github.com/users/asbjornu/events{/privacy}","received_events_url":"https://api.github.com/users/asbjornu/received_events","type":"User","site_admin":false},"body":"As discussed in #2369, here's a pull request for the `HttpLinkBuilder` class.","created_at":"2016-03-29T12:14:07Z","updated_at":"2016-04-02T20:33:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9719c0ff39f1ca3ff477bc9d92206e7d2fd65154","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NancyFx/Nancy/pulls/2389/commits","review_comments_url":"https://api.github.com/repos/NancyFx/Nancy/pulls/2389/comments","review_comment_url":"https://api.github.com/repos/NancyFx/Nancy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NancyFx/Nancy/issues/2389/comments","statuses_url":"https://api.github.com/repos/NancyFx/Nancy/statuses/0b5499a568325dbe0eba741e27d5a2191dbaeb32","head":{"label":"asbjornu:feature/link-builder","ref":"feature/link-builder","sha":"0b5499a568325dbe0eba741e27d5a2191dbaeb32","user":{"login":"asbjornu","id":12283,"avatar_url":"https://avatars.githubusercontent.com/u/12283?v=3","gravatar_id":"","url":"https://api.github.com/users/asbjornu","html_url":"https://github.com/asbjornu","followers_url":"https://api.github.com/users/asbjornu/followers","following_url":"https://api.github.com/users/asbjornu/following{/other_user}","gists_url":"https://api.github.com/users/asbjornu/gists{/gist_id}","starred_url":"https://api.github.com/users/asbjornu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asbjornu/subscriptions","organizations_url":"https://api.github.com/users/asbjornu/orgs","repos_url":"https://api.github.com/users/asbjornu/repos","events_url":"https://api.github.com/users/asbjornu/events{/privacy}","received_events_url":"https://api.github.com/users/asbjornu/received_events","type":"User","site_admin":false},"repo":{"id":3186590,"name":"Nancy","full_name":"asbjornu/Nancy","owner":{"login":"asbjornu","id":12283,"avatar_url":"https://avatars.githubusercontent.com/u/12283?v=3","gravatar_id":"","url":"https://api.github.com/users/asbjornu","html_url":"https://github.com/asbjornu","followers_url":"https://api.github.com/users/asbjornu/followers","following_url":"https://api.github.com/users/asbjornu/following{/other_user}","gists_url":"https://api.github.com/users/asbjornu/gists{/gist_id}","starred_url":"https://api.github.com/users/asbjornu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asbjornu/subscriptions","organizations_url":"https://api.github.com/users/asbjornu/orgs","repos_url":"https://api.github.com/users/asbjornu/repos","events_url":"https://api.github.com/users/asbjornu/events{/privacy}","received_events_url":"https://api.github.com/users/asbjornu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/asbjornu/Nancy","description":"A Sinatra inspired web framework for the .NET platform. Be sure to checkout the Wiki for information on how to contribute!","fork":true,"url":"https://api.github.com/repos/asbjornu/Nancy","forks_url":"https://api.github.com/repos/asbjornu/Nancy/forks","keys_url":"https://api.github.com/repos/asbjornu/Nancy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/asbjornu/Nancy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/asbjornu/Nancy/teams","hooks_url":"https://api.github.com/repos/asbjornu/Nancy/hooks","issue_events_url":"https://api.github.com/repos/asbjornu/Nancy/issues/events{/number}","events_url":"https://api.github.com/repos/asbjornu/Nancy/events","assignees_url":"https://api.github.com/repos/asbjornu/Nancy/assignees{/user}","branches_url":"https://api.github.com/repos/asbjornu/Nancy/branches{/branch}","tags_url":"https://api.github.com/repos/asbjornu/Nancy/tags","blobs_url":"https://api.github.com/repos/asbjornu/Nancy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/asbjornu/Nancy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/asbjornu/Nancy/git/refs{/sha}","trees_url":"https://api.github.com/repos/asbjornu/Nancy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/asbjornu/Nancy/statuses/{sha}","languages_url":"https://api.github.com/repos/asbjornu/Nancy/languages","stargazers_url":"https://api.github.com/repos/asbjornu/Nancy/stargazers","contributors_url":"https://api.github.com/repos/asbjornu/Nancy/contributors","subscribers_url":"https://api.github.com/repos/asbjornu/Nancy/subscribers","subscription_url":"https://api.github.com/repos/asbjornu/Nancy/subscription","commits_url":"https://api.github.com/repos/asbjornu/Nancy/commits{/sha}","git_commits_url":"https://api.github.com/repos/asbjornu/Nancy/git/commits{/sha}","comments_url":"https://api.github.com/repos/asbjornu/Nancy/comments{/number}","issue_comment_url":"https://api.github.com/repos/asbjornu/Nancy/issues/comments{/number}","contents_url":"https://api.github.com/repos/asbjornu/Nancy/contents/{+path}","compare_url":"https://api.github.com/repos/asbjornu/Nancy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/asbjornu/Nancy/merges","archive_url":"https://api.github.com/repos/asbjornu/Nancy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/asbjornu/Nancy/downloads","issues_url":"https://api.github.com/repos/asbjornu/Nancy/issues{/number}","pulls_url":"https://api.github.com/repos/asbjornu/Nancy/pulls{/number}","milestones_url":"https://api.github.com/repos/asbjornu/Nancy/milestones{/number}","notifications_url":"https://api.github.com/repos/asbjornu/Nancy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/asbjornu/Nancy/labels{/name}","releases_url":"https://api.github.com/repos/asbjornu/Nancy/releases{/id}","deployments_url":"https://api.github.com/repos/asbjornu/Nancy/deployments","created_at":"2012-01-15T22:59:58Z","updated_at":"2015-11-20T09:39:35Z","pushed_at":"2016-04-01T08:33:38Z","git_url":"git://github.com/asbjornu/Nancy.git","ssh_url":"git@github.com:asbjornu/Nancy.git","clone_url":"https://github.com/asbjornu/Nancy.git","svn_url":"https://github.com/asbjornu/Nancy","homepage":"","size":43782,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"NancyFx:master","ref":"master","sha":"1a4fe4d7dedad63ff3c27de294f1ff023f908386","user":{"login":"NancyFx","id":706659,"avatar_url":"https://avatars.githubusercontent.com/u/706659?v=3","gravatar_id":"","url":"https://api.github.com/users/NancyFx","html_url":"https://github.com/NancyFx","followers_url":"https://api.github.com/users/NancyFx/followers","following_url":"https://api.github.com/users/NancyFx/following{/other_user}","gists_url":"https://api.github.com/users/NancyFx/gists{/gist_id}","starred_url":"https://api.github.com/users/NancyFx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NancyFx/subscriptions","organizations_url":"https://api.github.com/users/NancyFx/orgs","repos_url":"https://api.github.com/users/NancyFx/repos","events_url":"https://api.github.com/users/NancyFx/events{/privacy}","received_events_url":"https://api.github.com/users/NancyFx/received_events","type":"Organization","site_admin":false},"repo":{"id":738250,"name":"Nancy","full_name":"NancyFx/Nancy","owner":{"login":"NancyFx","id":706659,"avatar_url":"https://avatars.githubusercontent.com/u/706659?v=3","gravatar_id":"","url":"https://api.github.com/users/NancyFx","html_url":"https://github.com/NancyFx","followers_url":"https://api.github.com/users/NancyFx/followers","following_url":"https://api.github.com/users/NancyFx/following{/other_user}","gists_url":"https://api.github.com/users/NancyFx/gists{/gist_id}","starred_url":"https://api.github.com/users/NancyFx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NancyFx/subscriptions","organizations_url":"https://api.github.com/users/NancyFx/orgs","repos_url":"https://api.github.com/users/NancyFx/repos","events_url":"https://api.github.com/users/NancyFx/events{/privacy}","received_events_url":"https://api.github.com/users/NancyFx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NancyFx/Nancy","description":"Lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono","fork":false,"url":"https://api.github.com/repos/NancyFx/Nancy","forks_url":"https://api.github.com/repos/NancyFx/Nancy/forks","keys_url":"https://api.github.com/repos/NancyFx/Nancy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NancyFx/Nancy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NancyFx/Nancy/teams","hooks_url":"https://api.github.com/repos/NancyFx/Nancy/hooks","issue_events_url":"https://api.github.com/repos/NancyFx/Nancy/issues/events{/number}","events_url":"https://api.github.com/repos/NancyFx/Nancy/events","assignees_url":"https://api.github.com/repos/NancyFx/Nancy/assignees{/user}","branches_url":"https://api.github.com/repos/NancyFx/Nancy/branches{/branch}","tags_url":"https://api.github.com/repos/NancyFx/Nancy/tags","blobs_url":"https://api.github.com/repos/NancyFx/Nancy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NancyFx/Nancy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NancyFx/Nancy/git/refs{/sha}","trees_url":"https://api.github.com/repos/NancyFx/Nancy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NancyFx/Nancy/statuses/{sha}","languages_url":"https://api.github.com/repos/NancyFx/Nancy/languages","stargazers_url":"https://api.github.com/repos/NancyFx/Nancy/stargazers","contributors_url":"https://api.github.com/repos/NancyFx/Nancy/contributors","subscribers_url":"https://api.github.com/repos/NancyFx/Nancy/subscribers","subscription_url":"https://api.github.com/repos/NancyFx/Nancy/subscription","commits_url":"https://api.github.com/repos/NancyFx/Nancy/commits{/sha}","git_commits_url":"https://api.github.com/repos/NancyFx/Nancy/git/commits{/sha}","comments_url":"https://api.github.com/repos/NancyFx/Nancy/comments{/number}","issue_comment_url":"https://api.github.com/repos/NancyFx/Nancy/issues/comments{/number}","contents_url":"https://api.github.com/repos/NancyFx/Nancy/contents/{+path}","compare_url":"https://api.github.com/repos/NancyFx/Nancy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NancyFx/Nancy/merges","archive_url":"https://api.github.com/repos/NancyFx/Nancy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NancyFx/Nancy/downloads","issues_url":"https://api.github.com/repos/NancyFx/Nancy/issues{/number}","pulls_url":"https://api.github.com/repos/NancyFx/Nancy/pulls{/number}","milestones_url":"https://api.github.com/repos/NancyFx/Nancy/milestones{/number}","notifications_url":"https://api.github.com/repos/NancyFx/Nancy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NancyFx/Nancy/labels{/name}","releases_url":"https://api.github.com/repos/NancyFx/Nancy/releases{/id}","deployments_url":"https://api.github.com/repos/NancyFx/Nancy/deployments","created_at":"2010-06-24T19:35:22Z","updated_at":"2016-04-02T11:14:26Z","pushed_at":"2016-04-01T12:38:14Z","git_url":"git://github.com/NancyFx/Nancy.git","ssh_url":"git@github.com:NancyFx/Nancy.git","clone_url":"https://github.com/NancyFx/Nancy.git","svn_url":"https://github.com/NancyFx/Nancy","homepage":"http://nancyfx.org","size":64044,"stargazers_count":3915,"watchers_count":3915,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1017,"mirror_url":null,"open_issues_count":129,"forks":1017,"open_issues":129,"watchers":3915,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NancyFx/Nancy/pulls/2389"},"html":{"href":"https://github.com/NancyFx/Nancy/pull/2389"},"issue":{"href":"https://api.github.com/repos/NancyFx/Nancy/issues/2389"},"comments":{"href":"https://api.github.com/repos/NancyFx/Nancy/issues/2389/comments"},"review_comments":{"href":"https://api.github.com/repos/NancyFx/Nancy/pulls/2389/comments"},"review_comment":{"href":"https://api.github.com/repos/NancyFx/Nancy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NancyFx/Nancy/pulls/2389/commits"},"statuses":{"href":"https://api.github.com/repos/NancyFx/Nancy/statuses/0b5499a568325dbe0eba741e27d5a2191dbaeb32"}}}}