{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1011","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1011/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1011/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1011/events","html_url":"https://github.com/ansible/ansible-modules-core/pull/1011","id":64734463,"number":1011,"title":"Add body_format for handling of JSON and YAML body","user":{"login":"zecrazytux","id":929169,"avatar_url":"https://avatars.githubusercontent.com/u/929169?v=3","gravatar_id":"","url":"https://api.github.com/users/zecrazytux","html_url":"https://github.com/zecrazytux","followers_url":"https://api.github.com/users/zecrazytux/followers","following_url":"https://api.github.com/users/zecrazytux/following{/other_user}","gists_url":"https://api.github.com/users/zecrazytux/gists{/gist_id}","starred_url":"https://api.github.com/users/zecrazytux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zecrazytux/subscriptions","organizations_url":"https://api.github.com/users/zecrazytux/orgs","repos_url":"https://api.github.com/users/zecrazytux/repos","events_url":"https://api.github.com/users/zecrazytux/events{/privacy}","received_events_url":"https://api.github.com/users/zecrazytux/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/feature_pull_request","name":"feature_pull_request","color":"009800"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/P2","name":"P2","color":"fad8c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":22,"created_at":"2015-03-27T10:24:04Z","updated_at":"2015-11-12T00:41:49Z","closed_at":"2015-03-30T11:35:17Z","pull_request":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/pulls/1011","html_url":"https://github.com/ansible/ansible-modules-core/pull/1011","diff_url":"https://github.com/ansible/ansible-modules-core/pull/1011.diff","patch_url":"https://github.com/ansible/ansible-modules-core/pull/1011.patch"},"body":"body_format is a new optional argument that enables handling of JSON or\r\nYAML serialization format for the body argument.\r\nWhen set to either 'json' or 'yaml', the body argument can be a dict or list.\r\nThe body will be encoded, and the Content-Type HTTP header will be set,\r\naccordingly to the body_format argument.\r\n\r\nExample:\r\n\r\n```\r\n- name: Facette - Create memory graph\r\n  uri:\r\n    method: POST\r\n    url: http://facette/api/v1/library/graphs\r\n    status_code: 201\r\n    body_format: json\r\n    body:\r\n      name: \"{{ ansible_fqdn }} - Memory usage\"\r\n      attributes:\r\n        Source\": \"{{ ansible_fqdn }}\"\r\n        link: \"1947a490-8ac6-4bf2-47c1-ff74272f8b32\"\r\n```"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/155958504","html_url":"https://github.com/ansible/ansible-modules-core/pull/1011#issuecomment-155958504","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1011","id":155958504,"user":{"login":"willthames","id":391807,"avatar_url":"https://avatars.githubusercontent.com/u/391807?v=3","gravatar_id":"","url":"https://api.github.com/users/willthames","html_url":"https://github.com/willthames","followers_url":"https://api.github.com/users/willthames/followers","following_url":"https://api.github.com/users/willthames/following{/other_user}","gists_url":"https://api.github.com/users/willthames/gists{/gist_id}","starred_url":"https://api.github.com/users/willthames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willthames/subscriptions","organizations_url":"https://api.github.com/users/willthames/orgs","repos_url":"https://api.github.com/users/willthames/repos","events_url":"https://api.github.com/users/willthames/events{/privacy}","received_events_url":"https://api.github.com/users/willthames/received_events","type":"User","site_admin":false},"created_at":"2015-11-12T00:41:49Z","updated_at":"2015-11-12T00:41:49Z","body":"Note that this bug where `to_json` is pointless is still in Ansible 2.0"}}