<?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: How To Make HTTP Requests with WordPress</title>
	<atom:link href="http://planetozh.com/blog/2009/08/how-to-make-http-requests-with-wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://planetozh.com/blog/2009/08/how-to-make-http-requests-with-wordpress/?source=rss</link>
	<description>A bit of my personal life, mainly focused on my kids. A bit of code, mainly focused on Wordpress and PHP. Overall, bits of nothing in particular.</description>
	<lastBuildDate>Wed, 08 Feb 2012 20:57:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: juust</title>
		<link>http://planetozh.com/blog/2009/08/how-to-make-http-requests-with-wordpress/comment-page-1/#comment-197366</link>
		<dc:creator>juust</dc:creator>
		<pubDate>Fri, 16 Dec 2011 22:23:32 +0000</pubDate>
		<guid isPermaLink="false">http://planetozh.com/blog/?p=1301#comment-197366</guid>
		<description>hi Ozh, do you have an idea when we get proxy support in the wrapper functions ?</description>
		<content:encoded><![CDATA[<p>hi Ozh, do you have an idea when we get proxy support in the wrapper functions ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: littlebearz</title>
		<link>http://planetozh.com/blog/2009/08/how-to-make-http-requests-with-wordpress/comment-page-1/#comment-164103</link>
		<dc:creator>littlebearz</dc:creator>
		<pubDate>Fri, 17 Jun 2011 02:03:54 +0000</pubDate>
		<guid isPermaLink="false">http://planetozh.com/blog/?p=1301#comment-164103</guid>
		<description>sorry for sounding stupid, how do i test the result response? in POST</description>
		<content:encoded><![CDATA[<p>sorry for sounding stupid, how do i test the result response? in POST</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: digitaldonkey</title>
		<link>http://planetozh.com/blog/2009/08/how-to-make-http-requests-with-wordpress/comment-page-1/#comment-130072</link>
		<dc:creator>digitaldonkey</dc:creator>
		<pubDate>Thu, 21 Oct 2010 12:10:33 +0000</pubDate>
		<guid isPermaLink="false">http://planetozh.com/blog/?p=1301#comment-130072</guid>
		<description>I&#039;m quite new in this issue. 
Anyone know how to speed things up?

I need to retrive a lot of Data (each Gallery Item) and things take Ages (1-5 sec.).

[php]
function get_REST_xml($uri) {
 global $settings;
 $WP_http_class_cache = $settings[&#039;g3Url&#039;];
 
 if (!isset($_SESSION[&#039;gallery3_cache&#039;][$WP_http_class_cache]) ) {
    echo &quot;INFO: created new Session&quot;;
    if( !class_exists( &#039;WP_Http&#039; ) ){
      require_once( ABSPATH . WPINC. &#039;/class-http.php&#039; );
    } 
    $_SESSION[&#039;gallery3_cache&#039;][$WP_http_class_cache] = new WP_Http;
  }
  if (! isset($_SESSION[&#039;gallery3_cache&#039;][$uri])){
    $this_req = $_SESSION[&#039;gallery3_cache&#039;][$WP_http_class_cache]-&gt;request( $uri );
    $_SESSION[&#039;gallery3_cache&#039;][$uri] = json_decode($this_req[&#039;body&#039;]);
  }
  return $_SESSION[&#039;gallery3_cache&#039;][$uri];
}
[/php]

When I use this cache second load is fast, but the first still takes a lot of time.
And I don&#039;t wanna use Ajax in order to keep it search engine readable.

Anyone knows what how to speed things up?</description>
		<content:encoded><![CDATA[<p>I'm quite new in this issue.<br />
Anyone know how to speed things up?</p>
<p>I need to retrive a lot of Data (each Gallery Item) and things take Ages (1-5 sec.).</p>
<div class="igBar"><span id="lphp-1"><a href="#" onclick="javascript:showPlainTxt('php-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-1">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> get_REST_xml<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$uri</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#000066;">global</span> <span style="color:#0000FF;">$settings</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#0000FF;">$WP_http_class_cache</span> = <span style="color:#0000FF;">$settings</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'g3Url'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>!<span style="color:#000066;">isset</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$_SESSION</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'gallery3_cache'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$WP_http_class_cache</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000066;">echo</span> <span style="color:#FF0000;">"INFO: created new Session"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span> !<span style="color:#000066;">class_exists</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'WP_Http'</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#616100;">require_once</span><span style="color:#006600; font-weight:bold;">&#40;</span> ABSPATH . WPINC. <span style="color:#FF0000;">'/class-http.php'</span> <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$_SESSION</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'gallery3_cache'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$WP_http_class_cache</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#000000; font-weight:bold;">new</span> WP_Http;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>! <span style="color:#000066;">isset</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$_SESSION</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'gallery3_cache'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$uri</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$this_req</span> = <span style="color:#0000FF;">$_SESSION</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'gallery3_cache'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$WP_http_class_cache</span><span style="color:#006600; font-weight:bold;">&#93;</span>-&amp;gt;request<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$uri</span> <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$_SESSION</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'gallery3_cache'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$uri</span><span style="color:#006600; font-weight:bold;">&#93;</span> = json_decode<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this_req</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'body'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$_SESSION</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'gallery3_cache'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$uri</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>When I use this cache second load is fast, but the first still takes a lot of time.<br />
And I don't wanna use Ajax in order to keep it search engine readable.</p>
<p>Anyone knows what how to speed things up?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nuwanda</title>
		<link>http://planetozh.com/blog/2009/08/how-to-make-http-requests-with-wordpress/comment-page-1/#comment-123701</link>
		<dc:creator>nuwanda</dc:creator>
		<pubDate>Sun, 12 Sep 2010 09:31:26 +0000</pubDate>
		<guid isPermaLink="false">http://planetozh.com/blog/?p=1301#comment-123701</guid>
		<description>Good for screen scraping ala Digg&#039;s new link thing?</description>
		<content:encoded><![CDATA[<p>Good for screen scraping ala Digg's new link thing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ozh</title>
		<link>http://planetozh.com/blog/2009/08/how-to-make-http-requests-with-wordpress/comment-page-1/#comment-108780</link>
		<dc:creator>Ozh</dc:creator>
		<pubDate>Mon, 31 May 2010 17:11:27 +0000</pubDate>
		<guid isPermaLink="false">http://planetozh.com/blog/?p=1301#comment-108780</guid>
		<description>Arvid » not sure I see where the problem is. When I wp_remote_get() a page that&#039;s gzipped, I get plain text just as a browser do. What&#039;s the particular API URL you&#039;re having problem with?</description>
		<content:encoded><![CDATA[<p>Arvid » not sure I see where the problem is. When I wp_remote_get() a page that's gzipped, I get plain text just as a browser do. What's the particular API URL you're having problem with?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arvid</title>
		<link>http://planetozh.com/blog/2009/08/how-to-make-http-requests-with-wordpress/comment-page-1/#comment-108766</link>
		<dc:creator>Arvid</dc:creator>
		<pubDate>Mon, 31 May 2010 15:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://planetozh.com/blog/?p=1301#comment-108766</guid>
		<description>i&#039;m using this in a project i&#039;m working on but there is one thing i just can&#039;t get to work. How do i use this to remote_get a GZip encoded api-response? i&#039;ve tried with wp_remote_retrieve_body( wp_remote_get($url, array(&#039;decompress&#039; =&gt; true)) ); and many other similair ways but i just can&#039;t get it to work. anybody got an idea how to do it?</description>
		<content:encoded><![CDATA[<p>i'm using this in a project i'm working on but there is one thing i just can't get to work. How do i use this to remote_get a GZip encoded api-response? i've tried with wp_remote_retrieve_body( wp_remote_get($url, array('decompress' =&gt; true)) ); and many other similair ways but i just can't get it to work. anybody got an idea how to do it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Konstantin Kovshenin</title>
		<link>http://planetozh.com/blog/2009/08/how-to-make-http-requests-with-wordpress/comment-page-1/#comment-106361</link>
		<dc:creator>Konstantin Kovshenin</dc:creator>
		<pubDate>Sun, 16 May 2010 15:43:18 +0000</pubDate>
		<guid isPermaLink="false">http://planetozh.com/blog/?p=1301#comment-106361</guid>
		<description>Actually, it&#039;s not the WP_Http class you have to use now, but the wrapper functions - wp_remote_get, etc: http://codex.wordpress.org/HTTP_API

Credit goes to @Viper007Bond ;)

Cheers!</description>
		<content:encoded><![CDATA[<p>Actually, it's not the WP_Http class you have to use now, but the wrapper functions - wp_remote_get, etc: <a href="http://codex.wordpress.org/HTTP_API" rel="nofollow">http://codex.wordpress.org/HTTP_API</a></p>
<p>Credit goes to @Viper007Bond ;)</p>
<p>Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EL</title>
		<link>http://planetozh.com/blog/2009/08/how-to-make-http-requests-with-wordpress/comment-page-1/#comment-104434</link>
		<dc:creator>EL</dc:creator>
		<pubDate>Thu, 29 Apr 2010 09:24:27 +0000</pubDate>
		<guid isPermaLink="false">http://planetozh.com/blog/?p=1301#comment-104434</guid>
		<description>Nice article. I just started to write my first WP Plugin. Where can i find the complete list of &quot;Wrapper Functions&quot; for Wordpress?</description>
		<content:encoded><![CDATA[<p>Nice article. I just started to write my first WP Plugin. Where can i find the complete list of "Wrapper Functions" for WordPress?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ozh</title>
		<link>http://planetozh.com/blog/2009/08/how-to-make-http-requests-with-wordpress/comment-page-1/#comment-102686</link>
		<dc:creator>Ozh</dc:creator>
		<pubDate>Tue, 06 Apr 2010 20:01:38 +0000</pubDate>
		<guid isPermaLink="false">http://planetozh.com/blog/?p=1301#comment-102686</guid>
		<description>rev » yeah, totally, always used wrapper functions when they exist. I was just toying with the class to understand how it works</description>
		<content:encoded><![CDATA[<p>rev » yeah, totally, always used wrapper functions when they exist. I was just toying with the class to understand how it works</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rev</title>
		<link>http://planetozh.com/blog/2009/08/how-to-make-http-requests-with-wordpress/comment-page-1/#comment-102668</link>
		<dc:creator>rev</dc:creator>
		<pubDate>Tue, 06 Apr 2010 17:53:46 +0000</pubDate>
		<guid isPermaLink="false">http://planetozh.com/blog/?p=1301#comment-102668</guid>
		<description>lol, I just realize there are 3 pages of comments and saw your stuff from before talking about the wrapper functions. However my conundrum still stands I think, thoughts?</description>
		<content:encoded><![CDATA[<p>lol, I just realize there are 3 pages of comments and saw your stuff from before talking about the wrapper functions. However my conundrum still stands I think, thoughts?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

