Merge pull request #50158 from vutny/doc/2017.7/fix-http-tutorial

[DOC] Fix JSON payload example in HTTP tutorial
This commit is contained in:
Nicole Thomas 2018-10-22 14:37:51 -04:00 committed by GitHub
commit aa66d1b7ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,15 +74,15 @@ be overridden with the ``method`` argument:
salt.utils.http.query('http://example.com/delete/url', 'DELETE')
When using the ``POST`` method (and others, such as ``PUT``), extra data is usually
sent as well. This data can be sent directly, in whatever format is
required by the remote server (XML, JSON, plain text, etc).
sent as well. This data can be sent directly (would be URL encoded when necessary),
or in whatever format is required by the remote server (XML, JSON, plain text, etc).
.. code-block:: python
salt.utils.http.query(
'http://example.com/delete/url',
'http://example.com/post/url',
method='POST',
data=json.loads(mydict)
data=json.dumps(mydict)
)
Data Formatting and Templating