Skip to content

Commit d2ec779

Browse files
committed
Allow POST for OAUTH2
1 parent 9a088a5 commit d2ec779

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ConstantContact/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ public function refreshToken() : bool
353353
// Set method and to expect response
354354
\curl_setopt($ch, CURLOPT_POST, true);
355355
\curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
356-
\curl_setopt($ch, CURLOPT_POSTFIELDS, '');
356+
\curl_setopt($ch, CURLOPT_POSTFIELDS, \json_encode($params));
357357

358358
return $this->exec($ch);
359359
}
@@ -543,7 +543,7 @@ private function setAuthorization(\CurlHandle $ch) : void
543543
// Base64 encode it
544544
$credentials = \base64_encode($auth);
545545
// Create and set the Authorization header to use the encoded credentials
546-
$headers = ['Authorization: Basic ' . $credentials, 'cache-control: no-cache', ];
546+
$headers = ['Authorization: Basic ' . $credentials, 'cache-control: no-cache', 'Content-Type: application/x-www-form-urlencoded'];
547547
\curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
548548
}
549549
}

0 commit comments

Comments
 (0)