fixed array instead of raw form-data

This commit is contained in:
xdrm-brackets 2017-01-28 17:59:54 +01:00
parent 94685a0210
commit 1b17ab8d38
1 changed files with 5 additions and 6 deletions

View File

@ -46,7 +46,7 @@
if( is_null($data) ){
slog("api:fetch returned unreadable content", 'api:sync');
$data = "{}";
$data = [];
}
@ -67,7 +67,7 @@
/* (1) Set post data */
$postarray = [
'token' => $hash,
'data' => $data
'data' => json_encode($data)
];
/* (2) Add renew if renew */
@ -90,10 +90,9 @@
/* [4] Manage headers
=========================================================*/
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"Content-Type: multipart/form-data; boundary=$boundary",
"Content-Length: ".strlen($postraw)
]);
#curl_setopt($curl, CURLOPT_HTTPHEADER, [
# "Content-Type: multipart/form-data"
#]);
/* [5] Send and catch request response