Zend_Http_Client provides an easy interface for preforming Hyper-Text Transfer Protocol (HTTP) requests. Zend_Http_Client supports most simple features expected from an HTTP client, as well as some more complex features such as HTTP authentication and file uploads.
Not all sites have feeds, but it's still useful to track everything in one place. This article shows how to use the Zend_HTTP_Client module to create a proxy to pull data into the feed-reader interface. In this article, you will learn:
* How to use the Zend_HTTP_Client module to load Web-site data.
* How to save the full text of feed entries and that of Web pages not supporting feeds.
* How to read the full text of saved feed entries within the feed-reader interface.
At the end of this article, you will have completed the framework of the feed-reader application. First, modify the database schema, then update the code to support the new schema. Next, add the functionality to save feed entry and Web pages to the database. Finally, use Zend_HTTP_Client to allow users to optionally save the entries to the database and view them in your updated online feed reader.
One of the things we introduced in the new client is the Â“connection adaptersÂ”: The idea is that there is a different object in charge of performing the actual communication with the server. This Â“adapterÂ” object can be replaced, and this way you get the same interface (the Zend_Http_Client interface), with a different method to connect to the server.