Hello ,
i want to insert donor details from PHP website to erpnext server… When i check my API from postman it will insert data successfully…but when i try to insert from PHP website server to erpnext local or global server…there is no response…any type of helps much much appreciated…below is my API details:
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://127.0.0.1:8000/api/resource/Donor",
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 =>"{\n \"donor_name\":\"Abhinaba\",\n \"donor_type\":\"Organization\",\n \"email\":\"abhisek@gmail.com\"\n}",
CURLOPT_HTTPHEADER => array(
"Authorization: token *****************:***************",
"Content-Type: application/json",
"Cookie: sid=Guest; system_user=yes; full_name=Guest; user_id=Guest; user_image="
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>