From 9668193b061b32c32cd967b2a30cf454b4494a28 Mon Sep 17 00:00:00 2001 From: sh-project <57087620+sh-project@users.noreply.github.com> Date: Mon, 1 Mar 2021 02:27:35 +0200 Subject: [PATCH] Update update-php.php Change the data to an array, and accordingly the continuation of the function. as in the creat-php.php file in this api. As well as changing the url, to api.powerlink. --- Update/update-php.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Update/update-php.php b/Update/update-php.php index 2e116b0..2a69ffd 100644 --- a/Update/update-php.php +++ b/Update/update-php.php @@ -1,12 +1,13 @@ -$data = '{ - "accountname" : "מושון" - }'; +$data = array( + "accountname" => "מושון" +); $objectid = '332DB2BF-3694-4F80-B82F-99F87B5AAB56'; -$url='https://secure.powerlink.co.il/api/record/account/'.$objectid -$data_string = json_encode($data); +$url='https://api.powerlink.co.il/api/record/account/'.$objectid +$data_string = json_encode($data); + $curl = curl_init(); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); -curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); +curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string); curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);