NYCPHP Meetup

NYPHP.org

[nycphp-talk] making a manual http POST using a PHP client (USPS web services)

Adam Maccabee Trachtenberg adam at trachtenberg.com
Mon Jul 12 12:39:04 EDT 2004


On Mon, 12 Jul 2004, Brian Kaney wrote:

> BTW: If you don't like the CURL library, I think you could try compiling
> PHP with OpenSSL (so you can go over https) and use the fopen() function
> (http://us4.php.net/function.fopen) or PEAR::HTTP module
> (http://pear.php.net/manual/en/package.http.php).

Yes, you can definitely also go with streams here in both PHP 4.3 and
PHP 5.

PHP 5, in particular, has http_build_query(), which simplifies the
task of constructing and urlencoding the query string. Then you can
use file_get_contents() to suck the whole file in a single gulp.

Shameless plug: there an example of this in "Upgrading to PHP 5,"
available from Amazon and finer bookstores later this month. (It
should be out in time for OSCON.)

-adam

-- 
adam at trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!



More information about the talk mailing list