j3k0 / wordpress-rest-api-experiment Goto Github PK
View Code? Open in Web Editor NEWWordpress REST API experiment
Wordpress REST API experiment
output:
# List of users
request: http://localhost:8002/wp-json/wp/v2/users
# List of pages
request: http://localhost:8002/wp-json/wp/v2/pages
# Create a post
- create authentication cookie
request: http://localhost:8002/api/user/generate_auth_cookie/?username=editor&password=123456&insecure=cool
- create a nonce
request: http://localhost:8002/api/get_nonce/?controller=posts&method=create_post&insecure=cool
- post post
cookie_name: wordpress_logged_in_20c11e91499787fd68da2884076a1c85
cookie: editor|1487144070|b3qNZU6PG7cUZM...
nonce: 7ed94e3231
request: http://localhost:8002/wp-json/wp/v2/posts?_wp_nonce=7ed94e3231 -d {} --header X-WP-Nonce: 7ed94e3231 --cookie wordpress_logged_in_20c11e91499787fd68da2884076a1c85=editor|1487144070|b3qNZU6PG7cUZM3gTo5JZ31Bco3XBZHWESYd1c8uEWE|de3edb6d7f8248a0692b4bca457ab35868129331c912fc5029724deafc8689b3
output:
{
"code": "rest_cookie_invalid_nonce",
"data": {
"status": 403
},
"message": "Cookie nonce is invalid"
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.