// CURL-less method with PHP5
$context = stream_context_create(array(
// use key 'http' even if you send the request to https
'http' => array(
//'header' and 'content' is optional
'header' => "Content-type: application/x-www-form-urlencoded
",
'method' => 'POST',
'content' => http_build_query(
array('key1' => 'value1', 'key2' => 'value2')
)
)
));
$result = file_get_contents('http://server.com/path', false, $context);
if ($result === FALSE) {
echo "an error occurred during post.";
http_response_code(500);
} else {
// success
var_dump($result);
}