arbeiten I Formulardaten an einen Dienst zu stellen, aber es zeigt einige Fehler mit Formularparametern, dies ist mein curl Skriptbeispiel:curl Postformulardaten nicht
<?php
// header('Content-Type:application/json');
$data = array();
$data = json_decode(file_get_contents('php://input'), true);
$user= $data["username"];
$pass= $data["password"];
$form_data = array('username' => $user, 'password' => $pass);
$url = "http://localhost:8585/auth/session";
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 75);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $form_data);
$result = curl_exec($ch);
curl_close($ch);
echo "result $result";
auf der Service-Seite es einen Fehler erzeugen dies wie:
@FormParam is utilized when the content type of the request entity is not application/x-www-form-urlencoded