Skip to content

Commit

Permalink
Merge pull request #5 from samwilson/set-endpoint
Browse files Browse the repository at this point in the history
Add ability to set custom endpoint URL
  • Loading branch information
Warat Wongmaneekit committed Oct 2, 2016
2 parents 327194e + 14ab705 commit 4d894e0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/GoogleCloudVision.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ class GoogleCloudVision

protected $version = "v1";

protected $urlEnpoint = "https://vision.googleapis.com/";
protected $endpoint = "https://vision.googleapis.com/";

protected $key;

public function setEndpoint($newEndpoint) {
$this->endpoint = $newEndpoint;
}

public function setImage($input, $type = "FILE")
{
if ($type == "GSC") {
Expand Down Expand Up @@ -119,7 +123,7 @@ public function request($endpoint = "annotate")
}

if ($endpoint == "annotate") {
$url = $this->urlEnpoint . $this->version . "/images:annotate?key=" . $this->key;
$url = $this->endpoint . $this->version . "/images:annotate?key=" . $this->key;
}
return $this->requestServer($url, $this->requestBody);
}
Expand Down

0 comments on commit 4d894e0

Please sign in to comment.