• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be 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.

Resolved Error 400 on POST request

jojo

New Pleskian
Hi,

When I perform a post request to a PHP script everything works fine, until I increase the header size, then I get an Error 400.

In the request header I have Token field, if it has around 14 characters or less, then the POST request goes through just fine, and I get read the token from the header.
If I increase the token size from 14 characters to something around 20 characters for example, I get error 400 and the post request fails.

The request header looks like this: (C++)
Code:
String data;
  data = F("POST /create.php HTTP/1.1\r\n");
  data += F("cache-control: no-cache\r\n");
  data += F("Content-Type: multipart/form-data; boundary=");
  data += BOUNDARY;
  data += "\r\n";
  data += F("User-Agent: mydevice/0.0.1\r\n");
  data += F("Accept: */*\r\n");
  data += F("Host: ");
  data += SERVER;
  data += F("\r\n");
  data += F("token: ");
  data += token;           // if this token is "1234567890101112" it works, if it's more than that, 400 error.
  data += "\r\n";
  data += F("accept-encoding: gzip, deflate\r\n");
  data += F("Connection: keep-alive\r\n");
  data += F("content-length: ");
  data += String(length);
  data += "\r\n";
  data += "\r\n";
  return (data);

Any help is appreciated.
 
Back
Top