8000 Added examples of doing requests with query params · binderjens/wc-api-python@0b67ae7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0b67ae7

Browse files
Added examples of doing requests with query params
Closes woocommerce#44
1 parent b7138db commit 0b67ae7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,26 @@ Example of returned data:
122122
>>> r.json()
123123
{u'products': [{u'sold_individually': False,... // Dictionary data
124124
125+
Request with `params` example
126+
-----------------------------
127+
128+
.. code-block:: python
129+
130+
from woocommerce import API
131+
132+
wcapi = API(
133+
url="http://example.com",
134+
consumer_key="ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
135+
consumer_secret="cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
136+
version="wc/v3"
137+
)
138+
139+
# Force delete example.
140+
print(wcapi.delete("products/100", params={"force": True}).json())
141+
142+
# Query example.
143+
print(wcapi.get("products", params={"per_page": 20}).json())
144+
125145
126146
Changelog
127147
---------

0 commit comments

Comments
 (0)
0