Commit acf8163b authored by Alex Ne's avatar Alex Ne

Debug

parent e95106bd
......@@ -29,7 +29,7 @@ class ServerToken extends VKAPI {
$params["grant_type"] = "client_credentials";
$params["v"] = $this->Credentials->get_api_version();
$data = $this->query($this->oauth_url . "access_token?", $params);
$data = $this->query($this->oauth_url . "access_token", $params);
if (isset($data["access_token"])) {
$this->server_token = $data["access_token"];
} else {
......
......@@ -51,8 +51,11 @@ class VKAPI {
protected function query($url, $params = []) {
$Client = new \X\Network\Http\Client($url);
$Client->set_model_data(["post" => $params]);
if ($data = $Client->exec()->json_decode()) {
$ClientResponse = $Client->exec();
if ($data = $ClientResponse->json_decode()) {
return $data;
} else {
return $ClientResponse->get_body();
}
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment