Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $url = 'https://www.newsletter2go.de/de/api/get/status';
- $data = [
- 'key' => 'UNSER-API-KEY'
- ];
- //url-ify the data for the POST
- foreach($data as $key=>$value) { $data_string .= $key.'='.$value.'&'; }
- $data_string = rtrim($data_string,'&');
- //debug
- echo($data_string);
- //open connection
- $ch = curl_init();
- //set the url, number of POST vars, POST data
- curl_setopt($ch,CURLOPT_URL,$url);
- curl_setopt($ch,CURLOPT_POST,count($data));
- curl_setopt($ch,CURLOPT_POSTFIELDS,$data_string);
- //execute post
- $result = curl_exec($ch);
- //debug
- print $result;
- //close curl
- curl_close($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement