Line 7... |
Line 7... |
7 |
* @package Framework
|
7 |
* @package Framework
|
8 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
8 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
9 |
* @copyright Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
|
9 |
* @copyright Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
|
10 |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
|
10 |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
|
11 |
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
|
11 |
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
|
12 |
* @version $Id: RestClient.php 349 2011-06-16 15:53:12Z jpm $
|
12 |
* @version $Id: RestClient.php 350 2011-06-16 16:50:33Z jpm $
|
13 |
*/
|
13 |
*/
|
14 |
class RestClient {
|
14 |
class RestClient {
|
15 |
const HTTP_URL_REQUETE_SEPARATEUR = '&';
|
15 |
const HTTP_URL_REQUETE_SEPARATEUR = '&';
|
16 |
const HTTP_URL_REQUETE_CLE_VALEUR_SEPARATEUR = '=';
|
16 |
const HTTP_URL_REQUETE_CLE_VALEUR_SEPARATEUR = '=';
|
17 |
private $http_methodes = array('GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', 'TRACE');
|
17 |
private $http_methodes = array('GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', 'TRACE');
|
Line 103... |
Line 103... |
103 |
|
103 |
|
104 |
private function traiterUrlParametres() {
|
104 |
private function traiterUrlParametres() {
|
105 |
$parametres = array();
|
105 |
$parametres = array();
|
106 |
if (count($this->parametres) > 0) {
|
106 |
if (count($this->parametres) > 0) {
|
- |
|
107 |
foreach ($this->parametres as $cle => $valeur) {
|
- |
|
108 |
$cle = rawurlencode($cle);
|
107 |
foreach ($this->parametres as $cle => $valeur) {
|
109 |
$valeur = rawurlencode($valeur);
|
108 |
$parametres[] = $cle.self::HTTP_URL_REQUETE_CLE_VALEUR_SEPARATEUR.$valeur;
|
110 |
$parametres[] = $cle.self::HTTP_URL_REQUETE_CLE_VALEUR_SEPARATEUR.$valeur;
|
109 |
}
|
111 |
}
|
110 |
$url_parametres = implode(self::HTTP_URL_REQUETE_SEPARATEUR, $parametres);
|
112 |
$url_parametres = implode(self::HTTP_URL_REQUETE_SEPARATEUR, $parametres);
|
111 |
$this->url = $this->url.'?'.$url_parametres;
|
113 |
$this->url = $this->url.'?'.$url_parametres;
|