You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+15-2Lines changed: 15 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,14 @@ Wordpress API - Python Client
4
4
A Python wrapper for the Wordpress and WooCommerce REST APIs with oAuth1a 3leg support.
5
5
6
6
Supports the Wordpress REST API v1-2, WooCommerce REST API v1-3 and WooCommerce WP-API v1-2 (with automatic OAuth3a handling).
7
-
Forked from the excellent Woocommerce API written by Claudio Sanches and modified to work with Wordpress: https://github.com/woocommerce/wc-api-python
7
+
Forked from the excellent WooCommerce API written by Claudio Sanches and modified to work with Wordpress: https://github.com/woocommerce/wc-api-python
8
8
9
9
I created this fork because I prefer the way that the wc-api-python client interfaces with
10
10
the Wordpress API compared to the existing python client, https://pypi.python.org/pypi/wordpress_json
11
11
which does not support OAuth authentication, only Basic Authentication (very unsecure)
12
12
13
-
Any suggestions about how this repository could be improved are welcome :)
13
+
Any comments about how you're using the API and suggestions about how this repository could be improved are welcome :).
14
+
You can find my contact info in my GitHub profile.
14
15
15
16
Roadmap
16
17
-------
@@ -259,6 +260,18 @@ Example of returned data:
259
260
>>> r.json()
260
261
{u'posts': [{u'sold_individually': False,... // Dictionary data
261
262
263
+
A note on DELETE requests.
264
+
=====
265
+
266
+
The extra keyword arguments passed to the functionof a `__request` call (such as `.delete()`) to a `wordpress.API` object are used to modify a `Requests.request` call, this is to allow you to specify custom parameters to modify how the request is made such as `headers`. At the moment it only passes the `headers` parameter to requests, but if I see a use casefor it, I can forward more of the parameters to `Requests`.
267
+
The `delete`functiondoesn’t accept a data object because a HTTP DELETE request does not typically have a payload, and some implementations of a HTTP server would reject a DELETE request that has a payload.
268
+
You can still pass api request parameters in the query string of the URL. I would suggest using a library like `urlparse` / `urllib.parse` to modify the query string if you are automatically deleting users.
269
+
According the the [documentation](https://developer.wordpress.org/rest-api/reference/users/#delete-a-user) for deleting a user, you need to pass the `force` and `reassign` parameters to the API, which can be done by appending them to the endpoint URL.
0 commit comments