Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function run()
- {
- $header = array(
- 'x-authorization: API_WEB_MITRA_COBA'
- );
- curl_setopt($this->initserver, CURLOPT_HTTPHEADER, $header);
- curl_setopt($this->initserver, CURLOPT_URL, $this->urls . $this->url_slug);
- curl_setopt($this->initserver, CURLOPT_POST, 1);
- curl_setopt($this->initserver, CURLOPT_POSTFIELDS, $this->params);
- curl_setopt($this->initserver, CURLOPT_RETURNTRANSFER, true);
- $server_output = curl_exec($this->initserver);
- $status_code = curl_getinfo($this->initserver, CURLINFO_HTTP_CODE);
- // echo $status_code;
- curl_close($this->initserver);
- // echo $server_output;
- //exit;
- if (!empty($server_output)) {
- $serdecode = json_decode($server_output, true);
- // print_r($serdecode);
- return $serdecode;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement