HTTP client is a PHP class for making HTTP requests. It can establish connections via a SOCKS server, send requests via a proxy server, and establish secure connections (HTTPS) with optional SSL client certificates. It supports HTTP authentication mechanisms like HTTP Basic, HTTP Digest, and NTLM (Windows or Samba). It submits POST requests with user-defined form values, file uploading, or with user-defined request bodies. It handles cookies and automatic redirection handling. There is an addon class to log in to Yahoo and execute actions on behalf of the user, like exporting the address book or sending invitations to Yahoo groups.
| Tags | Internet Web Software Development Libraries php classes |
|---|---|
| Licenses | BSD Original |
| Operating Systems | OS Independent |
| Implementation | PHP |
Recent releases


Changes: This release fixes the GetRequestArguments function so it resets the internal error variable to avoid accumulating errors over consecutive requests to different URLs or using different proxy servers.


Changes: A bug that was preventing to access SSL sites via proxies was fixed. A few functions with arguments that really did not need to be passed by reference were fixed.


Changes: This release adds support for SOCKS protocol version 4.


Changes: This release adds support for establishing SSL connections via non-SSL HTTP proxies.


Changes: This release provides support for streaming request body data in small chunks of undefined length using chunked transfer encoding for PUT and POST methods. The example script for sending SOAP requests was updated to use a Web service that is currently active.
- All comments
Recent commentsRe: Example of test_http_post.php with authentication
> I do not understand how to do a http
> post with digest authentication using
> the http.php class file.
>
> Would it be possible to add digest
> authentication to the test_http_post.php
> example to help me please
You need to include the SASL class. That is listed on the package dependencies.
BTW, in the future please use the package discussion forum (http://www.phpclasses.org/discuss/package/3/), as it is easier for me to provide support there.
Example of test_http_post.php with authentication
I do not understand how to do a http post with digest authentication using the http.php class file.
Would it be possible to add digest authentication to the test_http_post.php example to help me please
Re: Supporting HTTP Digest Authentication
In case you have not noticed, both the SASL package and the HTTP client class were updated and they support HTTP Digest authentication now.
Re: Supporting HTTP Digest Authentication
> I'm not sure if this is helpful, but in
> the comments for the fopen function
> someone posted some code that appears to
> interact (as a client) with HTTP digest
> servers, although they're using it
> specifically to do a file download:
> http://us2.php.net/manual/en/function.fopen.php#51592
>
I see. That may work in some cases, but the implementation is not really error proof. It is better to follow the HTTP Digest RFC to learn how to do it right.
Meanwhile I implemented it now. Both HTTP and SASL classes were updated to make it work. It can authenticate with Hotmail, but keep in mind that Microsoft restricts the access to Hotmail via Outlook Express to paying subscribers.
Re: Supporting HTTP Digest Authentication
> This should be sufficient to let me test
> a new SASL class plug-in that implements
> HTTP Digest authentication. I will try
> to develop that ASAP. Hang on.
I'm not sure if this is helpful, but in the comments for the fopen function someone posted some code that appears to interact (as a client) with HTTP digest servers, although they're using it specifically to do a file download:
http://us2.php.net/manual/en/function.fopen.php#51592