php - How do I send a POST request with params with WordPress REST API

admin2025-06-06  2

I am new to WordPress and I'm trying to make a POST request to login a user. I want to be able to send "username" and "password" as params while making this call. How can I do so. This my code so far

        register_rest_route(
            'custom-plugin', '/login/(?P<username>\d/(?P<password>\d)',  
              array(
                'methods'  => 'POST',
                 'callback' => 'login_user',
         ));
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749143217a316733.html

最新回复(0)