AlcohaulBSW Posted October 26, 2021 Posted October 26, 2021 We have suffering error when try to upload image of item. [ $path = base_path() .'/public'. $itemImage->photo; $file = file_get_contents($path); $dataBinary = base64_encode($file); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.loyverse.com/v1.0/items/89a38ddc-e810-465b-a174-15c2245adfdf/image', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $dataBinary, CURLOPT_HTTPHEADER => array( 'Content-Type: image/png', 'Content-Length: 1000', 'Authorization: Bearer b94601bb9cfb44edbcxxxxxxxxxxxxxxxxx', ), )); $response = curl_exec($curl); curl_close($curl); echo $response; ] Please provide solution as soon as possible... Thank You Team Geoalgo
Jay Rock Posted October 26, 2021 Posted October 26, 2021 Please try the same using Postman or any other sender with user interface, send to me example request and responses. It will help, find issue more faster. I'm not super familiar with php.
HDI Posted October 29, 2022 Posted October 29, 2022 Hi, get the same error. Using .Net, HttpClient any luck what causes the error ?
Recommended Posts