<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Simple cPanel XML api call using Ruby</title>
	<atom:link href="http://www.rajesharma.com/blog/articles/simple-cpanel-xml-api-call-using-ruby/feed" rel="self" type="application/rss+xml" />
	<link>http://www.rajesharma.com/blog/articles/simple-cpanel-xml-api-call-using-ruby</link>
	<description>&#039;isseme</description>
	<lastBuildDate>Tue, 21 Feb 2012 17:44:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Enrique</title>
		<link>http://www.rajesharma.com/blog/articles/simple-cpanel-xml-api-call-using-ruby#comment-122</link>
		<dc:creator>Enrique</dc:creator>
		<pubDate>Fri, 24 Sep 2010 05:24:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.rajesharma.com/blog/?p=172#comment-122</guid>
		<description>Awesome!  Thanks for including ruby code to have multiple parts for header.  I had the most challenging time finding an example to follow!</description>
		<content:encoded><![CDATA[<p>Awesome!  Thanks for including ruby code to have multiple parts for header.  I had the most challenging time finding an example to follow!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: broncha</title>
		<link>http://www.rajesharma.com/blog/articles/simple-cpanel-xml-api-call-using-ruby#comment-121</link>
		<dc:creator>broncha</dc:creator>
		<pubDate>Wed, 25 Aug 2010 16:04:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.rajesharma.com/blog/?p=172#comment-121</guid>
		<description>&lt;a href=&quot;#comment-120&quot; rel=&quot;nofollow&quot;&gt;@Prachi:&lt;/a&gt; If you see the snippet above I have used the HTTP authentication method.In your case, it would be:
&lt;code&gt;
easy.headers={&quot;Authorization&quot;=&gt;&quot;Basic &quot;+authStr+&quot;\r\n&quot;,
                &quot;Content-Type&quot;=&gt;&quot;application/x-www-form-urlencoded\r\n&quot;}
&lt;/code&gt;
The authStr is base64 encoded string with colon separated username and password.
Try with this code:
&lt;code&gt;
authStr = Base64.encode64(&quot;username:password&quot;)
easy = Curl::Easy.new(&#039;someurl&#039;)
easy.headers={&quot;Authorization&quot;=&gt;&quot;Basic &quot;+authStr+&quot;\r\n&quot;,
                &quot;Content-Type&quot;=&gt;&quot;application/x-www-form-urlencoded\r\n&quot;}
easy.perform
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p><a href="#comment-120" rel="nofollow">@Prachi:</a> If you see the snippet above I have used the HTTP authentication method.In your case, it would be:<br />
<code><br />
easy.headers={"Authorization"=&gt;"Basic "+authStr+"\r\n",<br />
                "Content-Type"=&gt;"application/x-www-form-urlencoded\r\n"}<br />
</code><br />
The authStr is base64 encoded string with colon separated username and password.<br />
Try with this code:<br />
<code><br />
authStr = Base64.encode64("username:password")<br />
easy = Curl::Easy.new('someurl')<br />
easy.headers={"Authorization"=&gt;"Basic "+authStr+"\r\n",<br />
                "Content-Type"=&gt;"application/x-www-form-urlencoded\r\n"}<br />
easy.perform<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prachi</title>
		<link>http://www.rajesharma.com/blog/articles/simple-cpanel-xml-api-call-using-ruby#comment-120</link>
		<dc:creator>Prachi</dc:creator>
		<pubDate>Wed, 25 Aug 2010 11:28:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.rajesharma.com/blog/?p=172#comment-120</guid>
		<description>Sorry for posting again, but I missed a little information in the previous comment. I get a &quot;401 not authorized&quot; error with that code snippet (I used the &lt;code&gt;on_body&lt;/code&gt; handler to print the response).</description>
		<content:encoded><![CDATA[<p>Sorry for posting again, but I missed a little information in the previous comment. I get a &#8220;401 not authorized&#8221; error with that code snippet (I used the <code>on_body</code> handler to print the response).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prachi</title>
		<link>http://www.rajesharma.com/blog/articles/simple-cpanel-xml-api-call-using-ruby#comment-119</link>
		<dc:creator>Prachi</dc:creator>
		<pubDate>Wed, 25 Aug 2010 11:23:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.rajesharma.com/blog/?p=172#comment-119</guid>
		<description>Hi,
Thanks for the snippet! :) Works fine.. But there&#039;s a little something that has been bothering me. I am using curb to access a page that requires HTTP authentication. The docs mention &#039;username=&#039; and &#039;password=&#039; methods to set the HTTP authentication username and password. But something like

&lt;code&gt;
easy = Curl::Easy.new(&#039;someurl&#039;) 
easy.username = &#039;username&#039; 
easy.password = &#039;password&#039; 
easy.perform
&lt;/code&gt;

does not work. I even set the http_auth_types with 

&lt;code&gt;
easy.http_auth_types = Curl::CURLAUTH_BASIC
&lt;/code&gt;

I might be doing something silly here. Could you hep me out?</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Thanks for the snippet! <img src='http://www.rajesharma.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Works fine.. But there&#8217;s a little something that has been bothering me. I am using curb to access a page that requires HTTP authentication. The docs mention &#8216;username=&#8217; and &#8216;password=&#8217; methods to set the HTTP authentication username and password. But something like</p>
<p><code><br />
easy = Curl::Easy.new('someurl')<br />
easy.username = 'username'<br />
easy.password = 'password'<br />
easy.perform<br />
</code></p>
<p>does not work. I even set the http_auth_types with </p>
<p><code><br />
easy.http_auth_types = Curl::CURLAUTH_BASIC<br />
</code></p>
<p>I might be doing something silly here. Could you hep me out?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

