Y
Y
Yuri Smith2017-06-07 16:31:44
Yii
Yuri Smith, 2017-06-07 16:31:44

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

2 answer(s)
M
Maxim Timofeev, 2017-06-07
@webinar

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.

G
gkarman, 2019-06-07
@gkarman

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 question

Ask a Question

731 491 924 answers to any question