496 |
eric |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
$mRoot = $_SERVER['DOCUMENT_ROOT'];
|
|
|
4 |
|
|
|
5 |
require_once($mRoot . '/tbframework_trunk/framework/Framework.php');
|
|
|
6 |
//require_once($mRoot . '/tbframework_trunk/framework/RestClient.php');
|
|
|
7 |
Framework::setCheminAppli(__FILE__); // Obligatoire
|
|
|
8 |
Framework::setInfoAppli(array('nom' => 'TestMonitorRestApiClient'));
|
|
|
9 |
|
|
|
10 |
$mRestClient = new RestClient();
|
|
|
11 |
|
|
|
12 |
$retour = $mRestClient->consulter("http://localhost/tbframework_trunk/tests/x-forwarded-for/test_x_forwarded_for_get.php");
|
|
|
13 |
|
|
|
14 |
echo "</br>Retour de la page appelée par GET :</br>";
|
|
|
15 |
echo $retour;
|
|
|
16 |
|
|
|
17 |
$donnees_post = array('var1' => 'Coucou', 'var2' => 'Beuh');
|
|
|
18 |
|
|
|
19 |
$retour = $mRestClient->modifier("http://localhost/tbframework_trunk/tests/x-forwarded-for/test_x_forwarded_for_post.php", $donnees_post);
|
|
|
20 |
|
|
|
21 |
echo "</br>Retour de la page appelée par POST :</br>";
|
|
|
22 |
echo $retour;
|