A library for sending HTTP requests from the server side. For example:
<?php
// in this case we use a configuration object
$config = new HttpRequestConfig();
$config->setOption("follow_location", true);
$config->setOption("user_agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36");
$config->setContentTypeOption("charset", "iso-8859-1");
// sends a POST request to mysite.com and attaches some files
$req = new HttpRequestPost($config);
$req->setParam("action", "upload-image");
$req->setFormParam("image", new HttpRequestFormFile("/path/to/image.jpg"));
echo $req->send("http://www.mysite.com");
?>
|