- file_get_contents: documentation ( source)
- var_dump: documentation ( source)
- stream_context_create: documentation ( source)
<?php
$url = 'triathlon.com/espresso-api/v1/authenticate?username=evenements&password=!Poumon123';
$data = array('key1' => 'value1', 'key2' => 'value2');
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
var_dump($result);