Hi,
i've set up a custom route for creating new menu items via the WP REST API. In Postman it works flawlessly but i can't get it to work with this package. The question is how i make a POST request with a custom route? Here is my code so far:
let wp = new WPAPI({
endpoint: 'http://xxxxxx',
username: 'xxxxx',
password: 'xxxxx'
});
wp.menuAPI = wp.registerRoute( 'wp-api-menus/v2', '/create-item/id=(?P<id>)');
wp.menuAPI().id(4).then(function( response ) {
console.log( response );
});
This makes a GET request, I need POST instead...
Thank you!
Hi,
i've set up a custom route for creating new menu items via the WP REST API. In Postman it works flawlessly but i can't get it to work with this package. The question is how i make a POST request with a custom route? Here is my code so far:
This makes a GET request, I need POST instead...
Thank you!