Hello everyone
I would like to create a php form to implement a configuration for my equipment.
I’m looking to transpose the curl request into php :
curl -i ‘http://genieIP:7557/devices/IDdevice/tasks?connection_request’
-X POST
–data ‘{“name”:“setParameterValues”, “parameterValues”: [[“InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.SSID”, “wifiname”, “xsd:string”],[“InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.PreSharedKey.1.PreSharedKey”, “helloworld”, “xsd:string”]]}’
$url = ‘http://genieIP:7557/devices/IDdevice/tasks?connection_request’;
$data = array(“name” => “setParameterValues”,“parameterValues” => array (“InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.SSID” => “wifiname”),“InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.PreSharedKey.1.PreSharedKey” => “helloworld”));
$postdata = json_encode($data);
print_r ($postdata);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(‘Content-Type: application/json’));
$result = curl_exec($ch);
curl_close($ch);
print_r ($result);
if you have any ideas because at the moment it doesn’t work.
Best Regards
Anthony