{"action":"created","comment":{"url":"https://api.github.com/repos/square/okhttp/pulls/comments/30010303","id":30010303,"diff_hunk":"@@ -29,13 +29,108 @@\n import okio.Buffer;\n \n /**\n- * A <a href=\"https://url.spec.whatwg.org/\">URL</a> with an {@code http} or {@code https} scheme.\n+ * A uniform resource locator (URL) with a scheme of either {@code http} or {@code https}. Use this\n+ * class to compose and decompose Internet addresses. For example, this code will compose and print\n+ * a URL for Google search: <pre>   {@code\n  *\n- * TODO: discussion on canonicalization\n+ *   HttpUrl url = new HttpUrl.Builder()\n+ *       .scheme(\"https\")\n+ *       .host(\"www.google.com\")\n+ *       .addPathSegment(\"search\")\n+ *       .addQueryParameter(\"q\", \"polar bears\")\n+ *       .build();\n+ *   System.out.println(url);\n+ * }</pre>\n  *\n- * TODO: discussion on encoding-by-parts\n+ * which prints: <pre>   {@code\n+ *\n+ *     https://www.google.com/search?q=polar+bears\n+ * }</pre>\n+ *\n+ * As another example, this code prints the human-readable query parameters of a Twitter search:\n+ * <pre>   {@code\n+ *\n+ *   HttpUrl url = HttpUrl.parse(\"https://twitter.com/search?q=cute%20%23puppies&f=images\");\n+ *   for (int i = 0, size = url.querySize(); i < size; i++) {\n+ *     System.out.println(url.queryParameterName(i) + \": \" + url.queryParameterValue(i));\n+ *   }\n+ * }</pre>\n+ *\n+ * which prints: <pre>   {@code\n+ *\n+ *   q: cute #puppies\n+ *   f: images\n+ * }</pre>\n+ *\n+ * In addition to composing URLs from their component parts, and decomposing URLs into their\n+ * component parts, this class implements relative URL resolution: what address you'd reach by\n+ * clicking a relative link on a specified page. For example: <pre>   {@code\n+ *\n+ *   HttpUrl base = HttpUrl.parse(\"https://www.youtube.com/user/WatchTheDaily/videos\");\n+ *   HttpUrl link = base.resolve(\"../../watch?v=cbP2N1BQdYc\");\n+ *   System.out.println(link);\n+ * }</pre>\n+ *\n+ * which prints <pre>   {@code\n+ *\n+ *   https://www.youtube.com/watch?v=cbP2N1BQdYc\n+ * }</pre>\n+ *\n+ * <h3>What's in a URL?</h3>\n+ *\n+ * A URL has several components.\n+ *\n+ * <h4>Scheme</h4>\n+ * Sometimes referred to as <i>protocol</i>, A URL's scheme describes what mechanism should be used\n+ * to retrieve the resource. Although URLs have many schemes (mailto, file, ftp), this class only","path":"okhttp/src/main/java/com/squareup/okhttp/HttpUrl.java","position":60,"original_position":60,"commit_id":"345600e1a3d926fbe0d0de11cd156573999ae750","original_commit_id":"345600e1a3d926fbe0d0de11cd156573999ae750","user":{"login":"JakeWharton","id":66577,"avatar_url":"https://avatars.githubusercontent.com/u/66577?v=3","gravatar_id":"","url":"https://api.github.com/users/JakeWharton","html_url":"https://github.com/JakeWharton","followers_url":"https://api.github.com/users/JakeWharton/followers","following_url":"https://api.github.com/users/JakeWharton/following{/other_user}","gists_url":"https://api.github.com/users/JakeWharton/gists{/gist_id}","starred_url":"https://api.github.com/users/JakeWharton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakeWharton/subscriptions","organizations_url":"https://api.github.com/users/JakeWharton/orgs","repos_url":"https://api.github.com/users/JakeWharton/repos","events_url":"https://api.github.com/users/JakeWharton/events{/privacy}","received_events_url":"https://api.github.com/users/JakeWharton/received_events","type":"User","site_admin":false},"body":"These schemes are not wrapped on code while http and https are. Normalize?","created_at":"2015-05-11T02:24:15Z","updated_at":"2015-05-11T02:24:15Z","html_url":"https://github.com/square/okhttp/pull/1623#discussion_r30010303","pull_request_url":"https://api.github.com/repos/square/okhttp/pulls/1623","_links":{"self":{"href":"https://api.github.com/repos/square/okhttp/pulls/comments/30010303"},"html":{"href":"https://github.com/square/okhttp/pull/1623#discussion_r30010303"},"pull_request":{"href":"https://api.github.com/repos/square/okhttp/pulls/1623"}}},"pull_request":{"url":"https://api.github.com/repos/square/okhttp/pulls/1623","id":35092400,"html_url":"https://github.com/square/okhttp/pull/1623","diff_url":"https://github.com/square/okhttp/pull/1623.diff","patch_url":"https://github.com/square/okhttp/pull/1623.patch","issue_url":"https://api.github.com/repos/square/okhttp/issues/1623","number":1623,"state":"open","locked":false,"title":"Docs on URL components.","user":{"login":"swankjesse","id":133019,"avatar_url":"https://avatars.githubusercontent.com/u/133019?v=3","gravatar_id":"","url":"https://api.github.com/users/swankjesse","html_url":"https://github.com/swankjesse","followers_url":"https://api.github.com/users/swankjesse/followers","following_url":"https://api.github.com/users/swankjesse/following{/other_user}","gists_url":"https://api.github.com/users/swankjesse/gists{/gist_id}","starred_url":"https://api.github.com/users/swankjesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swankjesse/subscriptions","organizations_url":"https://api.github.com/users/swankjesse/orgs","repos_url":"https://api.github.com/users/swankjesse/repos","events_url":"https://api.github.com/users/swankjesse/events{/privacy}","received_events_url":"https://api.github.com/users/swankjesse/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-11T01:17:02Z","updated_at":"2015-05-11T02:24:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"614a2815cc2c58e000793e0e1e8dc06d061b381a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/square/okhttp/pulls/1623/commits","review_comments_url":"https://api.github.com/repos/square/okhttp/pulls/1623/comments","review_comment_url":"https://api.github.com/repos/square/okhttp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/square/okhttp/issues/1623/comments","statuses_url":"https://api.github.com/repos/square/okhttp/statuses/345600e1a3d926fbe0d0de11cd156573999ae750","head":{"label":"square:jwilson_0510_components_docs","ref":"jwilson_0510_components_docs","sha":"345600e1a3d926fbe0d0de11cd156573999ae750","user":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":5152285,"name":"okhttp","full_name":"square/okhttp","owner":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/okhttp","description":"An HTTP+SPDY client for Android and Java applications.","fork":false,"url":"https://api.github.com/repos/square/okhttp","forks_url":"https://api.github.com/repos/square/okhttp/forks","keys_url":"https://api.github.com/repos/square/okhttp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/okhttp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/okhttp/teams","hooks_url":"https://api.github.com/repos/square/okhttp/hooks","issue_events_url":"https://api.github.com/repos/square/okhttp/issues/events{/number}","events_url":"https://api.github.com/repos/square/okhttp/events","assignees_url":"https://api.github.com/repos/square/okhttp/assignees{/user}","branches_url":"https://api.github.com/repos/square/okhttp/branches{/branch}","tags_url":"https://api.github.com/repos/square/okhttp/tags","blobs_url":"https://api.github.com/repos/square/okhttp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/okhttp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/okhttp/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/okhttp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/okhttp/statuses/{sha}","languages_url":"https://api.github.com/repos/square/okhttp/languages","stargazers_url":"https://api.github.com/repos/square/okhttp/stargazers","contributors_url":"https://api.github.com/repos/square/okhttp/contributors","subscribers_url":"https://api.github.com/repos/square/okhttp/subscribers","subscription_url":"https://api.github.com/repos/square/okhttp/subscription","commits_url":"https://api.github.com/repos/square/okhttp/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/okhttp/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/okhttp/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/okhttp/issues/comments{/number}","contents_url":"https://api.github.com/repos/square/okhttp/contents/{+path}","compare_url":"https://api.github.com/repos/square/okhttp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/okhttp/merges","archive_url":"https://api.github.com/repos/square/okhttp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/okhttp/downloads","issues_url":"https://api.github.com/repos/square/okhttp/issues{/number}","pulls_url":"https://api.github.com/repos/square/okhttp/pulls{/number}","milestones_url":"https://api.github.com/repos/square/okhttp/milestones{/number}","notifications_url":"https://api.github.com/repos/square/okhttp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/okhttp/labels{/name}","releases_url":"https://api.github.com/repos/square/okhttp/releases{/id}","created_at":"2012-07-23T13:42:55Z","updated_at":"2015-05-11T01:45:47Z","pushed_at":"2015-05-11T01:17:02Z","git_url":"git://github.com/square/okhttp.git","ssh_url":"git@github.com:square/okhttp.git","clone_url":"https://github.com/square/okhttp.git","svn_url":"https://github.com/square/okhttp","homepage":"http://square.github.io/okhttp/","size":28957,"stargazers_count":4381,"watchers_count":4381,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":993,"mirror_url":null,"open_issues_count":74,"forks":993,"open_issues":74,"watchers":4381,"default_branch":"master"}},"base":{"label":"square:master","ref":"master","sha":"3c27838cde4da2182c3538ced4fdfb210b3081b1","user":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":5152285,"name":"okhttp","full_name":"square/okhttp","owner":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/okhttp","description":"An HTTP+SPDY client for Android and Java applications.","fork":false,"url":"https://api.github.com/repos/square/okhttp","forks_url":"https://api.github.com/repos/square/okhttp/forks","keys_url":"https://api.github.com/repos/square/okhttp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/okhttp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/okhttp/teams","hooks_url":"https://api.github.com/repos/square/okhttp/hooks","issue_events_url":"https://api.github.com/repos/square/okhttp/issues/events{/number}","events_url":"https://api.github.com/repos/square/okhttp/events","assignees_url":"https://api.github.com/repos/square/okhttp/assignees{/user}","branches_url":"https://api.github.com/repos/square/okhttp/branches{/branch}","tags_url":"https://api.github.com/repos/square/okhttp/tags","blobs_url":"https://api.github.com/repos/square/okhttp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/okhttp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/okhttp/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/okhttp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/okhttp/statuses/{sha}","languages_url":"https://api.github.com/repos/square/okhttp/languages","stargazers_url":"https://api.github.com/repos/square/okhttp/stargazers","contributors_url":"https://api.github.com/repos/square/okhttp/contributors","subscribers_url":"https://api.github.com/repos/square/okhttp/subscribers","subscription_url":"https://api.github.com/repos/square/okhttp/subscription","commits_url":"https://api.github.com/repos/square/okhttp/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/okhttp/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/okhttp/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/okhttp/issues/comments{/number}","contents_url":"https://api.github.com/repos/square/okhttp/contents/{+path}","compare_url":"https://api.github.com/repos/square/okhttp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/okhttp/merges","archive_url":"https://api.github.com/repos/square/okhttp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/okhttp/downloads","issues_url":"https://api.github.com/repos/square/okhttp/issues{/number}","pulls_url":"https://api.github.com/repos/square/okhttp/pulls{/number}","milestones_url":"https://api.github.com/repos/square/okhttp/milestones{/number}","notifications_url":"https://api.github.com/repos/square/okhttp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/okhttp/labels{/name}","releases_url":"https://api.github.com/repos/square/okhttp/releases{/id}","created_at":"2012-07-23T13:42:55Z","updated_at":"2015-05-11T01:45:47Z","pushed_at":"2015-05-11T01:17:02Z","git_url":"git://github.com/square/okhttp.git","ssh_url":"git@github.com:square/okhttp.git","clone_url":"https://github.com/square/okhttp.git","svn_url":"https://github.com/square/okhttp","homepage":"http://square.github.io/okhttp/","size":28957,"stargazers_count":4381,"watchers_count":4381,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":993,"mirror_url":null,"open_issues_count":74,"forks":993,"open_issues":74,"watchers":4381,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/square/okhttp/pulls/1623"},"html":{"href":"https://github.com/square/okhttp/pull/1623"},"issue":{"href":"https://api.github.com/repos/square/okhttp/issues/1623"},"comments":{"href":"https://api.github.com/repos/square/okhttp/issues/1623/comments"},"review_comments":{"href":"https://api.github.com/repos/square/okhttp/pulls/1623/comments"},"review_comment":{"href":"https://api.github.com/repos/square/okhttp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/square/okhttp/pulls/1623/commits"},"statuses":{"href":"https://api.github.com/repos/square/okhttp/statuses/345600e1a3d926fbe0d0de11cd156573999ae750"}}}}