From 8ee21029933c313939a86979a64e545423a98923 Mon Sep 17 00:00:00 2001 From: whiter Date: Thu, 28 May 2015 15:27:46 +1000 Subject: [PATCH] Doc update to highlight use of body_type parameter --- lib/ansible/modules/network/basics/uri.py | 45 +++++++++++++++-------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/lib/ansible/modules/network/basics/uri.py b/lib/ansible/modules/network/basics/uri.py index 080b1ebce72..bcdd6090676 100644 --- a/lib/ansible/modules/network/basics/uri.py +++ b/lib/ansible/modules/network/basics/uri.py @@ -150,27 +150,40 @@ EXAMPLES = ''' # Create a JIRA issue - -- uri: url=https://your.jira.example.com/rest/api/2/issue/ - method=POST user=your_username password=your_pass - body="{{ lookup('file','issue.json') }}" force_basic_auth=yes - status_code=201 HEADER_Content-Type="application/json" +- uri: + url: https://your.jira.example.com/rest/api/2/issue/ + method: POST + user: your_username + password: your_pass + body: "{{ lookup('file','issue.json') }}" + force_basic_auth: yes + status_code: 201 + body_format: json # Login to a form based webpage, then use the returned cookie to # access the app in later tasks - -- uri: url=https://your.form.based.auth.examle.com/index.php - method=POST body="name=your_username&password=your_password&enter=Sign%20in" - status_code=302 HEADER_Content-Type="application/x-www-form-urlencoded" - register: login - -- uri: url=https://your.form.based.auth.example.com/dashboard.php - method=GET return_content=yes HEADER_Cookie="{{login.set_cookie}}" +- uri: + url: https://your.form.based.auth.examle.com/index.php + method: POST + body: "name=your_username&password=your_password&enter=Sign%20in" + status_code: 302 + HEADER_Content-Type: "application/x-www-form-urlencoded" + register: login + +- uri: + url: https://your.form.based.auth.example.com/dashboard.php + method: GET + return_content: yes + HEADER_Cookie: "{{login.set_cookie}}" # Queue build of a project in Jenkins: - -- uri: url=http://{{jenkins.host}}/job/{{jenkins.job}}/build?token={{jenkins.token}} - method=GET user={{jenkins.user}} password={{jenkins.password}} force_basic_auth=yes status_code=201 +- uri: + url: "http://{{ jenkins.host }}/job/{{ jenkins.job }}/build?token={{ jenkins.token }}" + method: GET + user: "{{ jenkins.user }}" + password: "{{ jenkins.password }}" + force_basic_auth: yes + status_code: 201 '''