setContentTypeOption("charset", "iso-8859-1"); // sends a POST request to receiver.php and prints the contents $req = new HttpRequestPost($config); $req->setParam("username", "john"); $req->setParam("password", "123456"); $req->setFormParam("image", new HttpRequestFormFile("image.jpg")); echo $req->send("http://$_SERVER[HTTP_HOST]/" . basename(__DIR__) . "/receiver.php");