Created
March 4, 2016 14:57
-
-
Save anonymous/da2892c64eec2d02fe64 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from wordpress_json import WordpressJsonWrapper | |
| import json | |
| # construct a wrapper | |
| wp = WordpressJsonWrapper("http://example.com/wp-json", "wp_user", "wp_password") | |
| # optional headers | |
| headers = { | |
| "User-Agent": "curl", | |
| "Content-Type": "text/json", | |
| # ... | |
| } | |
| # make requests, e.g. list posts | |
| print "----------- list posts -------------" | |
| posts = wp.get_posts() | |
| print json.dumps(posts); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment