Commit Graph

15 Commits (7a3383260620078fe4e797c3aad0588de71d3005)

Author SHA1 Message Date
Greg DeKoenigsberg 2a5f0bde87 Proper author info for all remaining modules 9 years ago
Toshio Kuratomi 5983d64d77 Properly flip default for verifying server cert. Add nice error messages when the cert is invalid 9 years ago
Toshio Kuratomi 7fea93835c Change uri module to validate ssl certs by default 9 years ago
whiter ba35cb8173 Doc update to highlight use of body_type parameter 9 years ago
Toshio Kuratomi b307f7bcba Fix problem writing binary content to a temporary file in the uri module.
Fixes https://github.com/ansible/ansible/issues/10938
Fixes https://github.com/ansible/ansible/issues/7606
10 years ago
Tom Paine 97b64abf75 Update uri.py
Move choices from description to choices field.
10 years ago
Schmitt Christian 9ebef6275d Removed the wrong Note
Currently as already in the description, this module works with proxy settings.
10 years ago
Sébastien Bocahu b2d570e991 Removes YAML body_format option
It would require adding a dependency to the YAML module while it might
not provide much benefit (has anybody seen a HTTP API taking YAML as
input ?)
10 years ago
Sébastien Bocahu 6b20c3890f Add body_format for handling of JSON and YAML body
body_format is a new optional argument that enables handling of JSON or
YAML serialization format for the body argument.
When set to either 'json' or 'yaml', the body argument can be a dict or list.
The body will be encoded, and the Content-Type HTTP header will be set,
accordingly to the body_format argument.

Example:

- name: Facette - Create memory graph
  uri:
    method: POST
    url: http://facette/api/v1/library/graphs
    status_code: 201
    body_format: json
    body:
      name: "{{ ansible_fqdn }} - Memory usage"
      attributes:
        Source": "{{ ansible_fqdn }}"
        link: "1947a490-8ac6-4bf2-47c1-ff74272f8b32"
10 years ago
Brian Coca 42d91951cf Merge pull request #537 from zitterbacke/patch-2
fix uri modul for JSON-escape quotation marks
should fix #121
10 years ago
Dan Rue c2f731e5bd Do not mark "skipped" when changed is false
When using the "creates" option with the uri module, set changed
to False if the file already exists. This behavior is consistent with
other modules which use "creates", such as command and shell.
10 years ago
zitterbacke 22e1b26bea fix uri modul for JSON-escape quotation marks
consider the following response body (content) of a REST/JSON webservice containing escaped quotation marks:

```json
{ "key": "\"works\"" }
```

decoding this string not as raw will lose the backslash as JSON escape. later json.loads will fail to parse.

Inspired by [this thread](https://groups.google.com/forum/#!topic/ansible-project/kymtiloDme4) on the mailing list and the following python shell code:

```python
import json
string=r'{ "key": "\"works\"" }'
json.loads(string)
json.loads(string.decode('raw_unicode_escape'))
json.loads(string.decode('unicode_escape'))
```
10 years ago
Toshio Kuratomi 9c6826e928 Add text/json as a mimetype to try deserializing
Fixes #503
10 years ago
Toshio Kuratomi 6317d3a988 Move from md5 to sha1 to work on FIPS-140 enabled systems 10 years ago
Michael DeHaan 0be8798858 Renames. 10 years ago