Skip to content

Commit 1b6e7cd

Browse files
authored
Merge pull request #4 from BrightLocal/fix/endpoint
Fix endpoint.
2 parents 7bc81c2 + 1fa481b commit 1b6e7cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/BrightLocal/Api.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ public function call($method, $params = array(), $httpMethod = self::HTTP_METHOD
8080
$client = new Client;
8181
try {
8282
if ($httpMethod === static::HTTP_METHOD_GET) {
83-
$result = $client->get($this->endpoint . $method, array('query' => $params));
83+
$result = $client->get($this->endpoint . '/' . ltrim($method, '/'), array('query' => $params));
8484
} else {
85-
$result = $client->$httpMethod($this->endpoint . $method, array('body' => $params));
85+
$result = $client->$httpMethod($this->endpoint . '/' . ltrim($method, '/'), array('body' => $params));
8686
}
8787
} catch (RequestException $e) {
8888
$result = $e->getResponse();

0 commit comments

Comments
 (0)