<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
 xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
>

<channel>
<title>Parallels knowledgebase (KB)</title>
<link>http://kb.parallels.com/</link>
<description>Parallels knowledgebase (KB)</description>
<language>en</language>
<copyright>Copyright 2008 Parallels</copyright>
<pubDate>Wed, 10 Sep 2008 00:00:00 +0600</pubDate>
<lastBuildDate>Wed, 10 Sep 2008 00:00:00 +0600</lastBuildDate>
<webMaster>rt-team@parallels.com</webMaster>

<item>
<title><![CDATA[Expand returns "HTTP/1.1 417 Expectation Failed" error instead of answer for XML API request.]]></title>
<link>http://kb.parallels.com/en/3964</link>
<description><![CDATA[<div id="article">
	




	<div id="kb" class="kb">
		<div class="article-container">
			<h2 class="title">Expand returns "HTTP/1.1 417 Expectation Failed" error instead of answer for XML API request.</h2>
			<div class="ab-frame"><div class="bl"><div class="br"><div class="tl"><div class="tr"><!-- frame -->
				<div class="articleProperty">
					<div>Article ID: 3964&nbsp;</div>
					<div>Last Review: Jun,2 2009</div>
					<tr>
						<td>Author: </td>
						<td>Vitaly Malakhov</td>
					</tr>
					<br/>
					<tr>
						<td>Last updated by: </td>
						<td>system</td>
					</tr>
					<strong>APPLIES TO:</strong>
					<div class="articleApplies">
						<ul>
							<li>Expand 2.x</li>
							<li>Parallels Plesk Panel</li>
						</ul>
					</div>
				</div><!-- articleProperty -->
			</div></div></div></div></div><!-- frame -->

			<div class="article-internal-flag"></div>

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


			<br/><br/>

			<div id="SubscriptionLink24Article" class="subscriptionLink2">
<a href="http://kb.parallels.com/subscriptions/index.html?Type=Article&ArticleID=3964&ArticleLanguage=en&Product=&Category="><img src="http://kb.parallels.com/images/mail.png" width="15" height="15" alt="Subscription for changes to this article"></a>
<a href="http://kb.parallels.com/subscriptions/index.html?Type=Article&ArticleID=3964&ArticleLanguage=en&Product=&Category=">Subscription for changes to this article</a>

<script type="text/javascript">

$(document).ready(function() {
	$('#SubscriptionLink24Article a').each(function(){
		$(this).click(function(event) {
			event.preventDefault();
			MainPageContentHide();
			$('#subscription').html('');
			$.get('/Stuff/Subscription', {
													'Type' : 'Article',
													'ArticleID' : '3964',
													'ArticleLanguage' : 'en',
													'Product' : '',
													'Category' : ''
												}, function(data) {
																	$('#subscription').html(data);
																	$('#subscription').show();
																	SUBbuildsubmenus_product();
																});
		});
	});
});

</script>

</div>





	</div><!-- kb -->

</div><!-- article -->


]]></description>
<author>Vitaly Malakhov</author>
<guid isPermaLink="false">3602 LastUpdated: 2009-06-02 09:36:14</guid>
<pubDate>2008-02-21 05:57:11</pubDate>
</item>
</channel>
</rss>



