Expand returns "HTTP/1.1 417 Expectation Failed" error instead of answer for XML API request.

Article ID: 3964 
Last Review: Oct,6 2008
Author: Vitaly Malakhov
Last updated by: system APPLIES TO:
  • 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.


Subscription for this article changesSubscription for this article changes

Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
* - required fields