{"action":"created","comment":{"url":"https://api.github.com/repos/ansible/ansible/pulls/comments/73965929","id":73965929,"diff_hunk":"@@ -870,22 +880,49 @@ def url_argument_spec():\n     that will be requesting content via urllib/urllib2\n     '''\n     return dict(\n-        url = dict(),\n-        force = dict(default='no', aliases=['thirsty'], type='bool'),\n-        http_agent = dict(default='ansible-httpget'),\n-        use_proxy = dict(default='yes', type='bool'),\n-        validate_certs = dict(default='yes', type='bool'),\n-        url_username = dict(required=False),\n-        url_password = dict(required=False),\n-        force_basic_auth = dict(required=False, type='bool', default='no'),\n+        url=dict(),\n+        force=dict(default='no', aliases=['thirsty'], type='bool'),\n+        http_agent=dict(default='ansible-httpget'),\n+        use_proxy=dict(default='yes', type='bool'),\n+        validate_certs=dict(default='yes', type='bool'),\n+        url_username=dict(required=False),\n+        url_password=dict(required=False),\n+        force_basic_auth=dict(required=False, type='bool', default='no'),\n \n     )\n \n \n def fetch_url(module, url, data=None, headers=None, method=None,\n               use_proxy=True, force=False, last_mod_time=None, timeout=10):\n     '''\n-    Fetches a file from an HTTP/FTP server using urllib2.  Requires the module environment\n+    Sends a request via HTTP(S) or FTP using urllib2 (Python2) or urllib (Python3)\n+\n+    Args:\n+        :module (AnsibleModule): The AnsibleModule (used to get username, password etc. (s.b.).\n+        :url:                    The url to use.\n+        :data:                   The data to be sent (in case of POST/PUT).\n+        :headers (dict):         A dict with the request headers.\n+        :method (String):        \"POST\", \"PUT\", etc.\n+        :use_proxy (Boolean):    Default: True\n+        :force (Boolean):        If True: Do not get a cached copy (Default: False)\n+        :last_mod_time:          Default: None\n+        :timeout (int):          Default: 10\n+\n+    Returns:\n+        :response: the response (body). Use `resp.body()` to read the data.\n+        :info:     status code and other meta data. When a HttpError (status > 400) occurred\n+                   then info['body'] contains the error response data::\n+\n+    Example:\n+        >>> data={...}\n+            resp, info = fetch_url(\"http://example.com\", \n+                                   data=module.jsonify(data)\n+                                   header={Content-type': 'application/json'},\n+                                   method=\"POST\")\n+            status_code = info[\"body\"]\n+            body = resp.read()\n+            if status_code >= 400 :\n+                body = info['body']","path":"lib/ansible/module_utils/urls.py","position":88,"original_position":88,"commit_id":"4bc2d6201cacdd95261d70a1d9d97989e94543f5","original_commit_id":"4bc2d6201cacdd95261d70a1d9d97989e94543f5","user":{"login":"abadger","id":209242,"avatar_url":"https://avatars.githubusercontent.com/u/209242?v=3","gravatar_id":"","url":"https://api.github.com/users/abadger","html_url":"https://github.com/abadger","followers_url":"https://api.github.com/users/abadger/followers","following_url":"https://api.github.com/users/abadger/following{/other_user}","gists_url":"https://api.github.com/users/abadger/gists{/gist_id}","starred_url":"https://api.github.com/users/abadger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abadger/subscriptions","organizations_url":"https://api.github.com/users/abadger/orgs","repos_url":"https://api.github.com/users/abadger/repos","events_url":"https://api.github.com/users/abadger/events{/privacy}","received_events_url":"https://api.github.com/users/abadger/received_events","type":"User","site_admin":false},"body":"Please use Sphinx's resturctured text format for API documentation.  There's an example of a method using that style of documentation here:  https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/connection/__init__.py#L159\r\n\r\nWe'll be building the html version of the documentation using sphinx so following that format will let these docstrings be used.  Sphinx's documentation is here: http://www.sphinx-doc.org/en/stable/tutorial.html","created_at":"2016-08-08T22:14:30Z","updated_at":"2016-08-08T22:14:30Z","html_url":"https://github.com/ansible/ansible/pull/16987#discussion_r73965929","pull_request_url":"https://api.github.com/repos/ansible/ansible/pulls/16987","_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments/73965929"},"html":{"href":"https://github.com/ansible/ansible/pull/16987#discussion_r73965929"},"pull_request":{"href":"https://api.github.com/repos/ansible/ansible/pulls/16987"}}},"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/16987","id":80364322,"html_url":"https://github.com/ansible/ansible/pull/16987","diff_url":"https://github.com/ansible/ansible/pull/16987.diff","patch_url":"https://github.com/ansible/ansible/pull/16987.patch","issue_url":"https://api.github.com/repos/ansible/ansible/issues/16987","number":16987,"state":"open","locked":false,"title":"16888: comment module_utils/urls.py","user":{"login":"kontrafiktion","id":198502,"avatar_url":"https://avatars.githubusercontent.com/u/198502?v=3","gravatar_id":"","url":"https://api.github.com/users/kontrafiktion","html_url":"https://github.com/kontrafiktion","followers_url":"https://api.github.com/users/kontrafiktion/followers","following_url":"https://api.github.com/users/kontrafiktion/following{/other_user}","gists_url":"https://api.github.com/users/kontrafiktion/gists{/gist_id}","starred_url":"https://api.github.com/users/kontrafiktion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kontrafiktion/subscriptions","organizations_url":"https://api.github.com/users/kontrafiktion/orgs","repos_url":"https://api.github.com/users/kontrafiktion/repos","events_url":"https://api.github.com/users/kontrafiktion/events{/privacy}","received_events_url":"https://api.github.com/users/kontrafiktion/received_events","type":"User","site_admin":false},"body":"##### ISSUE TYPE\r\n - Docs Pull Request\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.1.0.0\r\nconfig file =\r\nconfigured module search path = Default w/o overrides\r\n```\r\n\r\n##### SUMMARY\r\none step for #16888 ","created_at":"2016-08-07T11:06:35Z","updated_at":"2016-08-08T22:14:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9446633355ccdd527b0841be1bfbe200f4e4e5e2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ansible/ansible/pulls/16987/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible/pulls/16987/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/16987/comments","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/4bc2d6201cacdd95261d70a1d9d97989e94543f5","head":{"label":"kontrafiktion:16888_urls_doc","ref":"16888_urls_doc","sha":"4bc2d6201cacdd95261d70a1d9d97989e94543f5","user":{"login":"kontrafiktion","id":198502,"avatar_url":"https://avatars.githubusercontent.com/u/198502?v=3","gravatar_id":"","url":"https://api.github.com/users/kontrafiktion","html_url":"https://github.com/kontrafiktion","followers_url":"https://api.github.com/users/kontrafiktion/followers","following_url":"https://api.github.com/users/kontrafiktion/following{/other_user}","gists_url":"https://api.github.com/users/kontrafiktion/gists{/gist_id}","starred_url":"https://api.github.com/users/kontrafiktion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kontrafiktion/subscriptions","organizations_url":"https://api.github.com/users/kontrafiktion/orgs","repos_url":"https://api.github.com/users/kontrafiktion/repos","events_url":"https://api.github.com/users/kontrafiktion/events{/privacy}","received_events_url":"https://api.github.com/users/kontrafiktion/received_events","type":"User","site_admin":false},"repo":{"id":29348714,"name":"ansible","full_name":"kontrafiktion/ansible","owner":{"login":"kontrafiktion","id":198502,"avatar_url":"https://avatars.githubusercontent.com/u/198502?v=3","gravatar_id":"","url":"https://api.github.com/users/kontrafiktion","html_url":"https://github.com/kontrafiktion","followers_url":"https://api.github.com/users/kontrafiktion/followers","following_url":"https://api.github.com/users/kontrafiktion/following{/other_user}","gists_url":"https://api.github.com/users/kontrafiktion/gists{/gist_id}","starred_url":"https://api.github.com/users/kontrafiktion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kontrafiktion/subscriptions","organizations_url":"https://api.github.com/users/kontrafiktion/orgs","repos_url":"https://api.github.com/users/kontrafiktion/repos","events_url":"https://api.github.com/users/kontrafiktion/events{/privacy}","received_events_url":"https://api.github.com/users/kontrafiktion/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kontrafiktion/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.","fork":true,"url":"https://api.github.com/repos/kontrafiktion/ansible","forks_url":"https://api.github.com/repos/kontrafiktion/ansible/forks","keys_url":"https://api.github.com/repos/kontrafiktion/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kontrafiktion/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kontrafiktion/ansible/teams","hooks_url":"https://api.github.com/repos/kontrafiktion/ansible/hooks","issue_events_url":"https://api.github.com/repos/kontrafiktion/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/kontrafiktion/ansible/events","assignees_url":"https://api.github.com/repos/kontrafiktion/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/kontrafiktion/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/kontrafiktion/ansible/tags","blobs_url":"https://api.github.com/repos/kontrafiktion/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kontrafiktion/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kontrafiktion/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/kontrafiktion/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kontrafiktion/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/kontrafiktion/ansible/languages","stargazers_url":"https://api.github.com/repos/kontrafiktion/ansible/stargazers","contributors_url":"https://api.github.com/repos/kontrafiktion/ansible/contributors","subscribers_url":"https://api.github.com/repos/kontrafiktion/ansible/subscribers","subscription_url":"https://api.github.com/repos/kontrafiktion/ansible/subscription","commits_url":"https://api.github.com/repos/kontrafiktion/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/kontrafiktion/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/kontrafiktion/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/kontrafiktion/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/kontrafiktion/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/kontrafiktion/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kontrafiktion/ansible/merges","archive_url":"https://api.github.com/repos/kontrafiktion/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kontrafiktion/ansible/downloads","issues_url":"https://api.github.com/repos/kontrafiktion/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/kontrafiktion/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/kontrafiktion/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/kontrafiktion/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kontrafiktion/ansible/labels{/name}","releases_url":"https://api.github.com/repos/kontrafiktion/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/kontrafiktion/ansible/deployments","created_at":"2015-01-16T13:05:42Z","updated_at":"2016-02-18T14:41:59Z","pushed_at":"2016-08-07T11:02:46Z","git_url":"git://github.com/kontrafiktion/ansible.git","ssh_url":"git@github.com:kontrafiktion/ansible.git","clone_url":"https://github.com/kontrafiktion/ansible.git","svn_url":"https://github.com/kontrafiktion/ansible","homepage":"http://ansible.com/","size":34221,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"ansible:devel","ref":"devel","sha":"420a2f11af4034ed4ca43cfcc31a1ca01a8556ce","user":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?v=3","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"repo":{"id":3638964,"name":"ansible","full_name":"ansible/ansible","owner":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?v=3","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ansible/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.","fork":false,"url":"https://api.github.com/repos/ansible/ansible","forks_url":"https://api.github.com/repos/ansible/ansible/forks","keys_url":"https://api.github.com/repos/ansible/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ansible/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ansible/ansible/teams","hooks_url":"https://api.github.com/repos/ansible/ansible/hooks","issue_events_url":"https://api.github.com/repos/ansible/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/ansible/ansible/events","assignees_url":"https://api.github.com/repos/ansible/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/ansible/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/ansible/ansible/tags","blobs_url":"https://api.github.com/repos/ansible/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ansible/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ansible/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/ansible/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/ansible/ansible/languages","stargazers_url":"https://api.github.com/repos/ansible/ansible/stargazers","contributors_url":"https://api.github.com/repos/ansible/ansible/contributors","subscribers_url":"https://api.github.com/repos/ansible/ansible/subscribers","subscription_url":"https://api.github.com/repos/ansible/ansible/subscription","commits_url":"https://api.github.com/repos/ansible/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/ansible/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/ansible/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/ansible/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/ansible/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/ansible/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ansible/ansible/merges","archive_url":"https://api.github.com/repos/ansible/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ansible/ansible/downloads","issues_url":"https://api.github.com/repos/ansible/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/ansible/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/ansible/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/ansible/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ansible/ansible/labels{/name}","releases_url":"https://api.github.com/repos/ansible/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/ansible/ansible/deployments","created_at":"2012-03-06T14:58:02Z","updated_at":"2016-08-08T21:20:31Z","pushed_at":"2016-08-08T22:08:45Z","git_url":"git://github.com/ansible/ansible.git","ssh_url":"git@github.com:ansible/ansible.git","clone_url":"https://github.com/ansible/ansible.git","svn_url":"https://github.com/ansible/ansible","homepage":"http://ansible.com/","size":60122,"stargazers_count":18203,"watchers_count":18203,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5515,"mirror_url":null,"open_issues_count":1517,"forks":5515,"open_issues":1517,"watchers":18203,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/16987"},"html":{"href":"https://github.com/ansible/ansible/pull/16987"},"issue":{"href":"https://api.github.com/repos/ansible/ansible/issues/16987"},"comments":{"href":"https://api.github.com/repos/ansible/ansible/issues/16987/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible/pulls/16987/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible/pulls/16987/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible/statuses/4bc2d6201cacdd95261d70a1d9d97989e94543f5"}}}}
{"actor":{"display_login":"abadger"}}