Skip to content

Commit b17c0fa

Browse files
committed
Merge pull request #35 from thedaynews/master
Tiny cleanup
2 parents 0b763f0 + 0eb5c57 commit b17c0fa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Drewm/MailChimp.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ private function makeRequest($method, $args=array(), $timeout = 10)
5454
$args['apikey'] = $this->api_key;
5555

5656
$url = $this->api_endpoint.'/'.$method.'.json';
57+
$json_data = json_encode($args);
5758

5859
if (function_exists('curl_init') && function_exists('curl_setopt')){
5960
$ch = curl_init();
@@ -64,11 +65,10 @@ private function makeRequest($method, $args=array(), $timeout = 10)
6465
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
6566
curl_setopt($ch, CURLOPT_POST, true);
6667
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->verify_ssl);
67-
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($args));
68+
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
6869
$result = curl_exec($ch);
6970
curl_close($ch);
7071
} else {
71-
$json_data = json_encode($args);
7272
$result = file_get_contents($url, null, stream_context_create(array(
7373
'http' => array(
7474
'protocol_version' => 1.1,

0 commit comments

Comments
 (0)