• Debian 11 has reached its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.81 is the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

API Requests are Turned into GET Requests?

Patrick B

New Pleskian
This is a bug, right? A POST request to /wp-json/... should stay a POST request. ^^

To reproduce:
- Click the "send" button on a contact form 7 form. (Contact Form 7)
- right before clicking it, edit index.php to ' echo $_SERVER['REQUEST_METHOD'];'
It shows "GET" but the API request is clearly "POST" (dev tools says so, for example).

Here is the bad code:
/var/www/vhosts/system/DOMAIN.com/conf/nginx.conf
set $sef_entry_point /;
if ($uri ~* "^/") {
set $sef_entry_point "//index.php?$args";
}
error_page 404 = $sef_entry_point;
Without rewrites (i.e. with URLs like xyz.com?post_id=xxx or whatever), it stays "POST" since there it uses index.php?some_stuff...the_api_path so that no 404 is caused (see code below).
But with rewrites, this code turns it into GET, right? Unless custom permalinks are off (as said above), anyway.

I fixed it with my own code in the text input in the Plesk interface:
location /wp-json {
rewrite .* /index.php?$args;
}
Any thoughts on that?

Product version: Plesk Obsidian 18.0.27.1
OS version: Ubuntu 16.04 x86_64
Build date: 2020/05/22 12:00
Revision: 483fda892f6e4798504dcbd3348a557a7336d525

toolkit version - don't know how to find that one out
 
Back
Top