mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 16:45:27 +00:00
[DOC] Fix JSON payload example in HTTP tutorial
This commit is contained in:
parent
0662e37e0c
commit
fe2d70d4a3
@ -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…
Reference in New Issue
Block a user