The easiest way to send basic HTTP POST or GET requests is using PHP’s built in file_get_contents() function in conjunction with HTTP context options:
$data = http_build_query(
array(
'firstKey' => 'firstValue',
'secondKey' => 'secondValue',
'thirdKey' => 'thirdValue'
)
);
$options = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $data
)
);
$context = stream_context_create($options);
$result = file_get_contents('https://httpbin.org/post', false, $context);
Further reading:
