Skip to content

Commit 35c79ad

Browse files
author
Mohammad Kawsara
committed
changing get to post request for getMailingLists()
1 parent f9eaa4b commit 35c79ad

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/CampaignsClient.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function __construct(string $authToken)
6161
*/
6262
public function getMailingLists(string $sort = 'desc', int $fromIndex = null, int $range = null): object
6363
{
64-
return $this->getRequest('getmailinglists', [
64+
return $this->postRequest('getmailinglists', [
6565
'sort' => $sort,
6666
'fromindex' => $fromIndex,
6767
'range' => $range,
@@ -500,6 +500,17 @@ private function post($endPoint)
500500
return $this->client->post($this->getEndpoint($endPoint), $this->headers);
501501
}
502502

503+
private function get($endPoint)
504+
{
505+
if ($this->requestAsync === true) {
506+
$promise = $this->client->getAsync($this->getEndpoint($endPoint), $this->headers);
507+
508+
return (is_callable($this->requestCallback) ? $promise->then($this->requestCallback) : $promise);
509+
}
510+
511+
return $this->client->get($this->getEndpoint($endPoint), $this->headers);
512+
}
513+
503514
/**
504515
* @param $endPoint
505516
*

0 commit comments

Comments
 (0)