[ZF2] Récupérer les paramètres POST
Bonjour à tous,
Voici mon soucis :
En .NET, j'envoie une requête http://localhost/projet/index avec des paramètres "POST"
Le code C# :
Code:
1 2 3 4 5 6
|
WebClient client = new WebClient();
var values = new NameValueCollection();
values["myParam"] = "test";
var response = m_oClient.UploadValues("http://localhost/projet/index", "POST", values);
var responseString = Encoding.Default.GetString(response); |
Mais dans mon controller, ces fonctions me renvoient systématiquement null :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
public function indexAction()
{
$test1 = $this->getRequest()->getPost('myParam');
$test2 = $this->params()->fromPost('myParam');
// pour le debug
if($test1 == null || $test2 == null)
{
echo "pas de donnée reçues";
}
} |
Comment je peux faire pour que ça fonctionne ?
Merci à vous,
A bientôt