-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid http status: 414 #118
Comments
@Alexsisukin |
@NickArcher да... public function post(string $method, string $access_token, array $params = []): mixed
{
$query_data = [
self::PARAM_VERSION => $this->version,
self::PARAM_ACCESS_TOKEN => $access_token,
self::PARAM_LANG => $this->language,
];
try {
$response = $this->client->post(
"{$this->host}/{$method}?" . http_build_query($query_data),
[
'form_params' => $params,
]
);
if ($response->getStatusCode() !== static::HTTP_STATUS_CODE_OK) {
throw new VKClientException("Invalid http status: {$response->getStatusCode()}");
}
$body = $response->getBody()->getContents();
$decode_body = $this->decodeBody($body);
if (isset($decode_body[static::KEY_ERROR])) {
$error = $decode_body[static::KEY_ERROR];
$api_error = new VKApiError($error);
throw ExceptionMapper::parse($api_error);
}
if (isset($decode_body[static::KEY_RESPONSE])) {
return $decode_body[static::KEY_RESPONSE];
}
return $decode_body;
} catch (\Exception $exception) {
throw new VKClientException($exception);
}
} Очень странно что в sdk параметры передаются в query_string, а не в теле запроса , надеюсь это исправят |
vk-php-sdk/src/VK/Client/VKApiRequest.php
Line 90 in 72c7423
Получаю 414 ответ от api ранее использовал этот метод без проблем , судя из документации данные должны передаваться в теле запроса , но они в клиенте передаются query_string, это ошибка ?
данные которые пытаюсь передать методом \VK\Actions\Ads::createAds
The text was updated successfully, but these errors were encountered: