Article ID: 3964, created on Feb 27, 2009, last review on Apr 25, 2012

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

Síntomas

Envío una petición XML de API a Parallels Plesk Expand usando un script PHP o Perl. Si "Content-Length:" de la petición de la API es superior a 1024 bytes, se produce el error "Expectation Failed". El error tiene la siguiente apariencia:


> 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


Resolución

Añada la cabecera  "Expect:" a los scripts de su API, que ahora tienen la siguiente apariencia:

      $headers = array(
                "HTTP_AUTH_OP: $operator",
                "HTTP_AUTH_LOGIN: $login",
                "HTTP_AUTH_PASSWD: $passwd",
                "Content-Type: text/xml",
        );


y una vez realizada la adición, la cabecera debería ser:

      $headers = array(
                "HTTP_AUTH_OP: $operator",
                "HTTP_AUTH_LOGIN: $login",
                "HTTP_AUTH_PASSWD: $passwd",
                "Content-Type: text/xml",
                "Expect:",
        );


Esto solucionará el problema.

0316bb680a7c882e8693bf1bcd23642b a914db3fdc7a53ddcfd1b2db8f5a1b9c 8760abb54be64bdc3c8805b6572624e8 56797cefb1efc9130f7c48a7d1db0f0c

Email subscription for changes to this article
Save as PDF