Rest API using POST method not working PHP 7.1 NGINX
-
Hi there,
I am having some issues with the REST API. Whenever I use ‘GET’ method, it works fine. However, ‘POST’ method results in following error.
{“code”:”rest_no_route”,”message”:”No route was found matching the URL and request method”,”data”:{“status”:404}}My server is NGINX with php7.1 wordpress version: 4.9.6
Here is the action hook I used.
//rest api initadd_action('rest_api_init', function () { register_rest_route('test-url', '/submit-links', aarray( 'methods' => 'POST',//works perfect if GET method is used. 'callback' => array($this, submit_links_to_db), )); });
Nginx URL rewrite:
try_files $uri $uri/ /index.php$is_args$args;There is noting in the error logs. Please let me know if you need more information. I would really appreciate any help.
Thank you
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Rest API using POST method not working PHP 7.1 NGINX’ is closed to new replies.