<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Solution Log &#124; Antonio David - NVNCBL &#187; http</title>
	<atom:link href="http://www.nvncbl.com/tagged/http/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nvncbl.com</link>
	<description>A place to log my programming solutions for future reference</description>
	<lastBuildDate>Sun, 28 Aug 2011 01:20:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP HTTP Class 2</title>
		<link>http://www.nvncbl.com/2008/12/php-http-class-2/</link>
		<comments>http://www.nvncbl.com/2008/12/php-http-class-2/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 16:21:18 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=100</guid>
		<description><![CDATA[Revisiting the topic of my previous post, I&#8217;ve played around some more with this PHP HTTP Class.  This morning, I&#8217;ve figured out how to send files over HTTP (actually HTTPS, but it works the same way).  If you&#8217;ve looked through the author&#8217;s test scripts, you see that for file uploads, the provided example [...]]]></description>
			<content:encoded><![CDATA[<p>Revisiting the topic of my <a title="PHP HTTP Class" href="http://www.nvncbl.com/index.php/2008/12/php-http-class/" class="external">previous post</a>, I&#8217;ve played around some more with this <a title="PHP HTTP Class" href="http://www.phpclasses.org/browse/package/3.html" class="external">PHP HTTP Class</a>.  This morning, I&#8217;ve figured out how to send files over HTTP (actually HTTPS, but it works the same way).  If you&#8217;ve looked through the author&#8217;s test scripts, you see that for file uploads, the provided example is:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$arguments</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;PostFiles&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">&quot;userfile&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">&quot;Data&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;This is just a plain text attachment file.&quot;</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">&quot;Name&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;attachment.txt&quot;</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">&quot;Content-Type&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;automatic/name&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;anotherfile&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">&quot;FileName&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;test_http_post.php&quot;</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">&quot;Content-Type&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;automatic/name&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><span id="more-100"></span>So it&#8217;s actually pretty easy to send files.  This class provides two methods, as we&#8217;ve seen in the example.</p>
<ul>
<li><strong>userfile:</strong> The first example sends raw data and provides a filename</li>
<li><strong>anotherfile:</strong> The second example sends  the file specified in FileName</li>
</ul>
<p>Happy uploading!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2008/12/php-http-class-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP HTTP Class</title>
		<link>http://www.nvncbl.com/2008/12/php-http-class/</link>
		<comments>http://www.nvncbl.com/2008/12/php-http-class/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 00:18:25 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://www.nvncbl.com/?p=94</guid>
		<description><![CDATA[I&#8217;ve found a great PHP script that can essentially turn a web server into a virtual browser.  The script is small and lightweight compared to existing solutions (just 62KB) and it isn&#8217;t dependent on anything else.  I needed it for sending/receiving data through POST (because GET is easy), and more importantly, doing it over SSL.  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve found a great <a title="PHP HTTP Class" href="http://www.phpclasses.org/browse/package/3.html" class="external">PHP script</a> that can essentially turn a web server into a virtual browser.  The script is small and lightweight compared to existing solutions (just 62KB) and it isn&#8217;t dependent on anything else.  I needed it for sending/receiving data through POST (because GET is easy), and more importantly, doing it over SSL.  I still need to figure out how to upload files through this, but I don&#8217;t think it should be too big of an issue.  I&#8217;m sure it&#8217;s just a matter of encoding.</p>
<p><span id="more-94"></span>The script was found at <a title="PHP Classes" href="http://www.phpclasses.org" class="external">PHP Classes</a>, a resource I regularly tap into.  You&#8217;ll discover that PHP Classes requires registration, but it&#8217;s free and you can disable any email notifications.  Also, don&#8217;t be turned off by the website&#8217;s aesthetics, they were apparently going for &#8220;functional&#8221;.  Hey, it worked for <a title="Craigslist" href="http://www.craigslist.com" class="external">Craigslist</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nvncbl.com/2008/12/php-http-class/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

