Answer the question
In order to leave comments, you need to log in
Why does the vk API return an HTTP response code said error?
After installing yii2 and setting the domain for Callback API vk, the error "HTTP response code said error" appeared.
When requesting a third-party file, everything goes well.
What could be wrong?
Answer the question
In order to leave comments, you need to log in
go to the Callback address and see what happens there. I'm sure that yii2 has nothing to do with it. Rather, as Seryozha Akhen wrote, it's about redirects. For example http => https or www => without www.
Well, if it's in yii2, then the error is visible in the debug panel. And there is exhaustive information about what is wrong.
In Yii2, the request does not pass CSRF protection. You can disable it for this action. In your controller add.
public function beforeAction($action)
{
if (in_array($action->id, ['index'])) {
$this->enableCsrfValidation = false;
}
return parent::beforeAction($action);
}
Replace index with your action.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question