Answer the question
In order to leave comments, you need to log in
How to make POST REST API without authorization in Wordpress?
Hello!
How can I make a POST REST API without authorization in Wordpress?
For now, wp's answer gives the answer:
{
"code": "restx_logged_out",
"message": "Sorry, you must be logged in to make a request.",
"data": {
"status": 401
}
}
add_action('rest_api_init', function () {
register_rest_route('custom/v1', '/user', array(
'methods' => 'POST',
'permission_callback' => '__return_true',
'callback' => function (WP_REST_Request $Request) {
return $Request;
},
));
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question