Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function request($url, $data)
- {
- $url = $_SESSION['instance_url'].$url;
- $headers = [
- 'Authorization: Bearer '.$_SESSION['access_token'],
- 'content-type: text/csv',
- ];
- $curl = curl_init($url);
- curl_setopt($curl, CURLOPT_HEADER, false);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
- curl_setopt($curl, CURLOPT_PUT, true);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
- $json_response = curl_exec($curl);
- return json_decode($json_response, true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement