Symptoms
I send XML API request to Expand using PHP or Perl script. In case if "Content-Length:" of API request greater than 1024 bytes, the "Expectation Failed" error occurs. Full heards looks like:> POST /webgate.php HTTP/1.1
Host: 192.168.1.10:8442
Accept: */*
HTTP_AUTH_OP: exp_plesk_domain
HTTP_AUTH_LOGIN: admin
HTTP_AUTH_PASSWD: pass
Content-Type: text/xml
Content-Length: 1025
Expect: 100-continue
< HTTP/1.1 417 Expectation Failed
< Connection: close
< Content-Length: 0
< Date: Thu, 21 Feb 2008 07:41:43 GMT
< Server: sw-cp-server/1.0.0
<
* Closing connection #0
Resolution
Please add into your API scripts the "Expect:" header. Now it looks like:$headers = array(
"HTTP_AUTH_OP: $operator",
"HTTP_AUTH_LOGIN: $login",
"HTTP_AUTH_PASSWD: $passwd",
"Content-Type: text/xml",
);
and after adding the header it should be:
$headers = array(
"HTTP_AUTH_OP: $operator",
"HTTP_AUTH_LOGIN: $login",
"HTTP_AUTH_PASSWD: $passwd",
"Content-Type: text/xml",
"Expect:",
);
This will solve the problem.