mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Doc update to highlight use of body_type parameter
This commit is contained in:
parent
c291c2dfea
commit
8ee2102993
1 changed files with 28 additions and 15 deletions
|
@ -150,27 +150,40 @@ EXAMPLES = '''
|
||||||
|
|
||||||
|
|
||||||
# Create a JIRA issue
|
# Create a JIRA issue
|
||||||
|
- uri:
|
||||||
- uri: url=https://your.jira.example.com/rest/api/2/issue/
|
url: https://your.jira.example.com/rest/api/2/issue/
|
||||||
method=POST user=your_username password=your_pass
|
method: POST
|
||||||
body="{{ lookup('file','issue.json') }}" force_basic_auth=yes
|
user: your_username
|
||||||
status_code=201 HEADER_Content-Type="application/json"
|
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
|
# Login to a form based webpage, then use the returned cookie to
|
||||||
# access the app in later tasks
|
# 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.examle.com/index.php
|
- uri:
|
||||||
method=POST body="name=your_username&password=your_password&enter=Sign%20in"
|
url: https://your.form.based.auth.example.com/dashboard.php
|
||||||
status_code=302 HEADER_Content-Type="application/x-www-form-urlencoded"
|
method: GET
|
||||||
register: login
|
return_content: yes
|
||||||
|
HEADER_Cookie: "{{login.set_cookie}}"
|
||||||
- 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:
|
# Queue build of a project in Jenkins:
|
||||||
|
- uri:
|
||||||
- uri: url=http://{{jenkins.host}}/job/{{jenkins.job}}/build?token={{jenkins.token}}
|
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
|
method: GET
|
||||||
|
user: "{{ jenkins.user }}"
|
||||||
|
password: "{{ jenkins.password }}"
|
||||||
|
force_basic_auth: yes
|
||||||
|
status_code: 201
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue