• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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