<?php
if(isset($_POST['method']))
{
    $method = $_POST['method'];
    unset($_POST['method']);
    $params = http_build_query($_POST);
    $result = file_get_contents("http://37.187.116.215/projects/REST%20TP/server.php" . ($method == "DELETE" || $method == "GET" ? "?" . $params : ""), false, stream_context_create(array('http' => array("method" => $method, 'header' => "Content-Type: application/x-www-form-urlencoded\r\n", "content" => $params))));
    echo '<pre>' . $result . '</pre>';
}

?>
<form method="post" action="client.php">
    <select name="method">
        <option>GET</option>
        <option>POST</option>
        <option>PUT</option>
        <option>DELETE</option>
    </select><br>
    <label for="id">ID : </label><input id="id" type="text" name="id"><br>
    <label for="nom">Nom : </label><input id="nom" type="text" name="nom"><br>
    <label for="prenom">Prénom : </label><input id="prenom" type="text" name="prenom"><br>
    <input type="submit">
</form>
