HttpClient - a PHP Web Client Class
Download HttpClient (txt) | HttpClient Manual | HttpClient Examples | HttpClient Demo
Version 0.9, Simon Willison April 6th 2003
HttpClient is a client class for the HTTP protocol. It can be used to interact with another web server from within a PHP script. As well as retrieving information from a server, HttpClient can interact with a server via POST or GET. It can therefore be used as part of any script that needs to communicate with an application running on another site.
Features
- Implements a useful subset of the HTTP 1.0 and 1.1 protocols.
- Includes cookie support.
- Ability to set the user agent and referal fields.
- Can automatically handle redirected pages.
- Can be used for multiple requests, with any cookies sent by the server resent for each additional request.
-
- Support for gzip encoded content, which can dramatically reduce the amount of bandwidth used in a transaction.
- Object oriented, with static methods providing a useful shortcut for simple requests.
- The ability to only read the page headers - useful for implementing tools such as link checkers.
- Support for file uploads.
Planned for future releases
- Improved cookie support.
- Built in support for Etags and Last-Modified headers.
- Debugging mode.
Alternatives