{{:: 'controllers.documentation.chooseFramework' | translate }}
function post($url, $postVars = array()){ $postStr = http_build_query($postVars); $options = array( 'http' => array( 'method' => 'POST', //We are using the POST HTTP method. 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postStr //Our URL-encoded query string. ) ); $streamContext = stream_context_create($options); $result = file_get_contents($url, false, $streamContext); if($result === false){ $error = error_get_last(); throw new Exception('POST request failed: ' . $error['message']); } return $result; }