Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = 'bumnceria';
- $password = 'pinku';
- $key='INGNE-123token-verifikator'; // token untuk akses masuk ke aplikasi
- $parma = json_encode(
- array(
- 'username' => $username, // username yg di berikan untuk akses api
- 'password'=>$password, //password yg di berikan untuk akses api
- //'request'=>'showdata', //action yg akan di request
- 'request'=>'get_pembiayaan', //action yg akan di request
- 'nik'=>'642003',
- 'norek'=>'6420035655',
- )
- );
- /*end konfigurasi post data*/
- /*konfigurasi header */
- $header = array(
- 'Auth: '.$key
- );
- /*end konfigurasi header*/
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,"http://localhost/mobile2/public_html/apispengajuan/");
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS,$parma);
- curl_setopt($ch, CURLOPT_HTTPHEADER,$header);
- // receive server response ...
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $server_output = curl_exec ($ch);
- curl_close ($ch);
- if(!empty($server_output)){
- $serdecode = ($server_output);
- print_r($serdecode);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement