Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
1.2 kB
1
Indexable
Never
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://www.sistemweb.my.id/save-register',
  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 =>'{
    "name" : "'.$request->fullname.'",
    "nik" : "'.$request->nik.'",
    "email" : "'.$request->email_register.'", 
    "department_id" : "'.$request->roleid.'", 
    "phone" : "'.$request->telpno.'", 
    "kdprov" : "'.$request->kdprov.'", 
    "kdkab" : "'.$request->kdkab.'",
    "kdkec" : "'.$request->kdkec.'",
    "kddesa" : "'.$request->kdkec.'",
    "is_admin" : 0,
    "birth_date" : "'.$request->tgl_lahir.'", 
    "gender" : "'.$request->jenis_kelamin.'",
    "address"  : "'.$request->alamat.'",
    "password" : "'.Hash::make($request->password).'",
}',
  CURLOPT_HTTPHEADER => array(
    'token: aW50ZWdyYXNpbW9uZXZsYXBraW4yMDI0a2VtZW5kZXNh',
    'Content-Type: application/json',
  ),
));

$response = curl_exec($curl);
curl_close($curl);
Leave a Comment