Article ID: 3964, created on Feb 21, 2008, last review on May 4, 2014

  • Applies to:
  • Plesk
  • Plesk Expand 2.x

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.

0316bb680a7c882e8693bf1bcd23642b a914db3fdc7a53ddcfd1b2db8f5a1b9c 8760abb54be64bdc3c8805b6572624e8 56797cefb1efc9130f7c48a7d1db0f0c

Email subscription for changes to this article
Save as PDF