mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
commit
aa66d1b7ba
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue