{"action":"opened","number":119,"pull_request":{"url":"https://api.github.com/repos/SWI-Prolog/packages-http/pulls/119","id":233294839,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzMjk0ODM5","html_url":"https://github.com/SWI-Prolog/packages-http/pull/119","diff_url":"https://github.com/SWI-Prolog/packages-http/pull/119.diff","patch_url":"https://github.com/SWI-Prolog/packages-http/pull/119.patch","issue_url":"https://api.github.com/repos/SWI-Prolog/packages-http/issues/119","number":119,"state":"open","locked":false,"title":"Accept status codes 201 thru 299 as successful","user":{"login":"Anniepoo","id":146569,"node_id":"MDQ6VXNlcjE0NjU2OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/146569?v=4","gravatar_id":"","url":"https://api.github.com/users/Anniepoo","html_url":"https://github.com/Anniepoo","followers_url":"https://api.github.com/users/Anniepoo/followers","following_url":"https://api.github.com/users/Anniepoo/following{/other_user}","gists_url":"https://api.github.com/users/Anniepoo/gists{/gist_id}","starred_url":"https://api.github.com/users/Anniepoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anniepoo/subscriptions","organizations_url":"https://api.github.com/users/Anniepoo/orgs","repos_url":"https://api.github.com/users/Anniepoo/repos","events_url":"https://api.github.com/users/Anniepoo/events{/privacy}","received_events_url":"https://api.github.com/users/Anniepoo/received_events","type":"User","site_admin":false},"body":"Current behavior of http_open without an explicit status_code option is to throw an existance error for status codes 201 through 299.\r\nThis is explicitly incorrect for 201 (created), 202 (accepted), 203 (non-authoritative), 204 (no content), 205(reset content), and 206 (partial content). It is expected behavior for all other 201-299 codes.\r\n\r\n[RFC2616](https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html)\r\n\r\nThis PR causes http_open to treat status codes 201-299 as equivalent to 200 when there is no explicit status_code option.\r\n\r\nBehavior of HEAD\r\n?- http_open:http_open('https://httpstat.us/200', Stream, []), open_null_stream(Null), copy_stream_data(Stream, Null).\r\nStream = <stream>(0x558ddeb39e10,0x558ddeb39f20),\r\nNull = <stream>(0x558ddeb3a030).\r\n\r\n?- http_open:http_open('https://httpstat.us/201', Stream, []), open_null_stream(Null), copy_stream_data(Stream, Null).\r\nERROR: url `'https://httpstat.us/201'' does not exist (status(201,Created))\r\nERROR: In:\r\nERROR:   [12] throw(error(existence_error(url,'https://httpstat.us/201'),context(_686,...)))\r\nERROR:   [10] http_open:try_http_proxy(direct,'<garbage_collected>','<garbage_collected>','<garbage_collected>') at /home/anniepoo/.swivm/versions/7.7.18/lib/swipl-7.7.18/library/http/http_open.pl:418\r\nERROR:    [8] '<meta-call>'('<garbage_collected>') <foreign>\r\nERROR:    [7] <user>\r\nERROR: \r\nERROR: Note: some frames are missing due to last-call optimization.\r\nERROR: Re-run your program in debug mode (:- debug.) to get more detail.\r\n?- \r\n\r\nfollowing change\r\n\r\n?- http_open:http_open('https://httpstat.us/201', Stream, []), open_null_stream(Null), copy_stream_data(Stream, Null).\r\nStream = <stream>(0x558dde9d7a50,0x558ddea0f1e0),\r\nNull = <stream>(0x558dde73f050).\r\n\r\n?- \r\n\r\n?- http_open:http_open('https://httpstat.us/201', Stream, [status_code(Code)]), open_null_\r\nStream = <stream>(0x558dde6bf040,0x558ddea09620),\r\nCode = 201,\r\nNull = <stream>(0x558dde6b33a0).","created_at":"2018-11-24T01:35:56Z","updated_at":"2018-11-24T01:35:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/SWI-Prolog/packages-http/pulls/119/commits","review_comments_url":"https://api.github.com/repos/SWI-Prolog/packages-http/pulls/119/comments","review_comment_url":"https://api.github.com/repos/SWI-Prolog/packages-http/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SWI-Prolog/packages-http/issues/119/comments","statuses_url":"https://api.github.com/repos/SWI-Prolog/packages-http/statuses/f2bf0ceb2fad94bded639ed49c9f919c637b060f","head":{"label":"Anniepoo:anniepoo","ref":"anniepoo","sha":"f2bf0ceb2fad94bded639ed49c9f919c637b060f","user":{"login":"Anniepoo","id":146569,"node_id":"MDQ6VXNlcjE0NjU2OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/146569?v=4","gravatar_id":"","url":"https://api.github.com/users/Anniepoo","html_url":"https://github.com/Anniepoo","followers_url":"https://api.github.com/users/Anniepoo/followers","following_url":"https://api.github.com/users/Anniepoo/following{/other_user}","gists_url":"https://api.github.com/users/Anniepoo/gists{/gist_id}","starred_url":"https://api.github.com/users/Anniepoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anniepoo/subscriptions","organizations_url":"https://api.github.com/users/Anniepoo/orgs","repos_url":"https://api.github.com/users/Anniepoo/repos","events_url":"https://api.github.com/users/Anniepoo/events{/privacy}","received_events_url":"https://api.github.com/users/Anniepoo/received_events","type":"User","site_admin":false},"repo":{"id":158888420,"node_id":"MDEwOlJlcG9zaXRvcnkxNTg4ODg0MjA=","name":"packages-http","full_name":"Anniepoo/packages-http","private":false,"owner":{"login":"Anniepoo","id":146569,"node_id":"MDQ6VXNlcjE0NjU2OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/146569?v=4","gravatar_id":"","url":"https://api.github.com/users/Anniepoo","html_url":"https://github.com/Anniepoo","followers_url":"https://api.github.com/users/Anniepoo/followers","following_url":"https://api.github.com/users/Anniepoo/following{/other_user}","gists_url":"https://api.github.com/users/Anniepoo/gists{/gist_id}","starred_url":"https://api.github.com/users/Anniepoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anniepoo/subscriptions","organizations_url":"https://api.github.com/users/Anniepoo/orgs","repos_url":"https://api.github.com/users/Anniepoo/repos","events_url":"https://api.github.com/users/Anniepoo/events{/privacy}","received_events_url":"https://api.github.com/users/Anniepoo/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Anniepoo/packages-http","description":"The SWI-Prolog HTTP server and client libraries","fork":true,"url":"https://api.github.com/repos/Anniepoo/packages-http","forks_url":"https://api.github.com/repos/Anniepoo/packages-http/forks","keys_url":"https://api.github.com/repos/Anniepoo/packages-http/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Anniepoo/packages-http/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Anniepoo/packages-http/teams","hooks_url":"https://api.github.com/repos/Anniepoo/packages-http/hooks","issue_events_url":"https://api.github.com/repos/Anniepoo/packages-http/issues/events{/number}","events_url":"https://api.github.com/repos/Anniepoo/packages-http/events","assignees_url":"https://api.github.com/repos/Anniepoo/packages-http/assignees{/user}","branches_url":"https://api.github.com/repos/Anniepoo/packages-http/branches{/branch}","tags_url":"https://api.github.com/repos/Anniepoo/packages-http/tags","blobs_url":"https://api.github.com/repos/Anniepoo/packages-http/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Anniepoo/packages-http/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Anniepoo/packages-http/git/refs{/sha}","trees_url":"https://api.github.com/repos/Anniepoo/packages-http/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Anniepoo/packages-http/statuses/{sha}","languages_url":"https://api.github.com/repos/Anniepoo/packages-http/languages","stargazers_url":"https://api.github.com/repos/Anniepoo/packages-http/stargazers","contributors_url":"https://api.github.com/repos/Anniepoo/packages-http/contributors","subscribers_url":"https://api.github.com/repos/Anniepoo/packages-http/subscribers","subscription_url":"https://api.github.com/repos/Anniepoo/packages-http/subscription","commits_url":"https://api.github.com/repos/Anniepoo/packages-http/commits{/sha}","git_commits_url":"https://api.github.com/repos/Anniepoo/packages-http/git/commits{/sha}","comments_url":"https://api.github.com/repos/Anniepoo/packages-http/comments{/number}","issue_comment_url":"https://api.github.com/repos/Anniepoo/packages-http/issues/comments{/number}","contents_url":"https://api.github.com/repos/Anniepoo/packages-http/contents/{+path}","compare_url":"https://api.github.com/repos/Anniepoo/packages-http/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Anniepoo/packages-http/merges","archive_url":"https://api.github.com/repos/Anniepoo/packages-http/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Anniepoo/packages-http/downloads","issues_url":"https://api.github.com/repos/Anniepoo/packages-http/issues{/number}","pulls_url":"https://api.github.com/repos/Anniepoo/packages-http/pulls{/number}","milestones_url":"https://api.github.com/repos/Anniepoo/packages-http/milestones{/number}","notifications_url":"https://api.github.com/repos/Anniepoo/packages-http/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Anniepoo/packages-http/labels{/name}","releases_url":"https://api.github.com/repos/Anniepoo/packages-http/releases{/id}","deployments_url":"https://api.github.com/repos/Anniepoo/packages-http/deployments","created_at":"2018-11-24T00:10:19Z","updated_at":"2018-11-24T00:10:21Z","pushed_at":"2018-11-24T01:20:01Z","git_url":"git://github.com/Anniepoo/packages-http.git","ssh_url":"git@github.com:Anniepoo/packages-http.git","clone_url":"https://github.com/Anniepoo/packages-http.git","svn_url":"https://github.com/Anniepoo/packages-http","homepage":null,"size":6456,"stargazers_count":0,"watchers_count":0,"language":"Prolog","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SWI-Prolog:master","ref":"master","sha":"c193e5ee3780d78bfc89e3c1b14c233c81120848","user":{"login":"SWI-Prolog","id":6884283,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4ODQyODM=","avatar_url":"https://avatars2.githubusercontent.com/u/6884283?v=4","gravatar_id":"","url":"https://api.github.com/users/SWI-Prolog","html_url":"https://github.com/SWI-Prolog","followers_url":"https://api.github.com/users/SWI-Prolog/followers","following_url":"https://api.github.com/users/SWI-Prolog/following{/other_user}","gists_url":"https://api.github.com/users/SWI-Prolog/gists{/gist_id}","starred_url":"https://api.github.com/users/SWI-Prolog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SWI-Prolog/subscriptions","organizations_url":"https://api.github.com/users/SWI-Prolog/orgs","repos_url":"https://api.github.com/users/SWI-Prolog/repos","events_url":"https://api.github.com/users/SWI-Prolog/events{/privacy}","received_events_url":"https://api.github.com/users/SWI-Prolog/received_events","type":"Organization","site_admin":false},"repo":{"id":19143755,"node_id":"MDEwOlJlcG9zaXRvcnkxOTE0Mzc1NQ==","name":"packages-http","full_name":"SWI-Prolog/packages-http","private":false,"owner":{"login":"SWI-Prolog","id":6884283,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4ODQyODM=","avatar_url":"https://avatars2.githubusercontent.com/u/6884283?v=4","gravatar_id":"","url":"https://api.github.com/users/SWI-Prolog","html_url":"https://github.com/SWI-Prolog","followers_url":"https://api.github.com/users/SWI-Prolog/followers","following_url":"https://api.github.com/users/SWI-Prolog/following{/other_user}","gists_url":"https://api.github.com/users/SWI-Prolog/gists{/gist_id}","starred_url":"https://api.github.com/users/SWI-Prolog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SWI-Prolog/subscriptions","organizations_url":"https://api.github.com/users/SWI-Prolog/orgs","repos_url":"https://api.github.com/users/SWI-Prolog/repos","events_url":"https://api.github.com/users/SWI-Prolog/events{/privacy}","received_events_url":"https://api.github.com/users/SWI-Prolog/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/SWI-Prolog/packages-http","description":"The SWI-Prolog HTTP server and client libraries","fork":false,"url":"https://api.github.com/repos/SWI-Prolog/packages-http","forks_url":"https://api.github.com/repos/SWI-Prolog/packages-http/forks","keys_url":"https://api.github.com/repos/SWI-Prolog/packages-http/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SWI-Prolog/packages-http/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SWI-Prolog/packages-http/teams","hooks_url":"https://api.github.com/repos/SWI-Prolog/packages-http/hooks","issue_events_url":"https://api.github.com/repos/SWI-Prolog/packages-http/issues/events{/number}","events_url":"https://api.github.com/repos/SWI-Prolog/packages-http/events","assignees_url":"https://api.github.com/repos/SWI-Prolog/packages-http/assignees{/user}","branches_url":"https://api.github.com/repos/SWI-Prolog/packages-http/branches{/branch}","tags_url":"https://api.github.com/repos/SWI-Prolog/packages-http/tags","blobs_url":"https://api.github.com/repos/SWI-Prolog/packages-http/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SWI-Prolog/packages-http/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SWI-Prolog/packages-http/git/refs{/sha}","trees_url":"https://api.github.com/repos/SWI-Prolog/packages-http/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SWI-Prolog/packages-http/statuses/{sha}","languages_url":"https://api.github.com/repos/SWI-Prolog/packages-http/languages","stargazers_url":"https://api.github.com/repos/SWI-Prolog/packages-http/stargazers","contributors_url":"https://api.github.com/repos/SWI-Prolog/packages-http/contributors","subscribers_url":"https://api.github.com/repos/SWI-Prolog/packages-http/subscribers","subscription_url":"https://api.github.com/repos/SWI-Prolog/packages-http/subscription","commits_url":"https://api.github.com/repos/SWI-Prolog/packages-http/commits{/sha}","git_commits_url":"https://api.github.com/repos/SWI-Prolog/packages-http/git/commits{/sha}","comments_url":"https://api.github.com/repos/SWI-Prolog/packages-http/comments{/number}","issue_comment_url":"https://api.github.com/repos/SWI-Prolog/packages-http/issues/comments{/number}","contents_url":"https://api.github.com/repos/SWI-Prolog/packages-http/contents/{+path}","compare_url":"https://api.github.com/repos/SWI-Prolog/packages-http/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SWI-Prolog/packages-http/merges","archive_url":"https://api.github.com/repos/SWI-Prolog/packages-http/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SWI-Prolog/packages-http/downloads","issues_url":"https://api.github.com/repos/SWI-Prolog/packages-http/issues{/number}","pulls_url":"https://api.github.com/repos/SWI-Prolog/packages-http/pulls{/number}","milestones_url":"https://api.github.com/repos/SWI-Prolog/packages-http/milestones{/number}","notifications_url":"https://api.github.com/repos/SWI-Prolog/packages-http/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SWI-Prolog/packages-http/labels{/name}","releases_url":"https://api.github.com/repos/SWI-Prolog/packages-http/releases{/id}","deployments_url":"https://api.github.com/repos/SWI-Prolog/packages-http/deployments","created_at":"2014-04-25T11:25:52Z","updated_at":"2018-11-20T16:18:28Z","pushed_at":"2018-11-20T16:18:26Z","git_url":"git://github.com/SWI-Prolog/packages-http.git","ssh_url":"git@github.com:SWI-Prolog/packages-http.git","clone_url":"https://github.com/SWI-Prolog/packages-http.git","svn_url":"https://github.com/SWI-Prolog/packages-http","homepage":null,"size":6456,"stargazers_count":10,"watchers_count":10,"language":"Prolog","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":19,"license":null,"forks":9,"open_issues":19,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SWI-Prolog/packages-http/pulls/119"},"html":{"href":"https://github.com/SWI-Prolog/packages-http/pull/119"},"issue":{"href":"https://api.github.com/repos/SWI-Prolog/packages-http/issues/119"},"comments":{"href":"https://api.github.com/repos/SWI-Prolog/packages-http/issues/119/comments"},"review_comments":{"href":"https://api.github.com/repos/SWI-Prolog/packages-http/pulls/119/comments"},"review_comment":{"href":"https://api.github.com/repos/SWI-Prolog/packages-http/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SWI-Prolog/packages-http/pulls/119/commits"},"statuses":{"href":"https://api.github.com/repos/SWI-Prolog/packages-http/statuses/f2bf0ceb2fad94bded639ed49c9f919c637b060f"}},"author_association":"MEMBER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":7,"deletions":3,"changed_files":1}}
{"actor":{"display_login":"Anniepoo"}}