L
L
Leopandro2017-01-25 10:12:00
Yii
Leopandro, 2017-01-25 10:12:00

Why the 400 bad request. error?

behaviours:

[
                'allow' => true,
                'roles' => ['?'],
                'verbs' => ['POST', 'GET'],
                'actions' => [
                  'get-info', 'add'
                ]
              ],

those. action-s get-info and add are available to all users.
But the post request for actions returns 400 bad request and requires authorization ... how to fix it?
And GET requests work.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton, 2017-01-25
@karminski

$behaviors[] = [
            'class' => VerbFilter::className(),
            'actions' => [
                'delete' => ['delete'],
                'copy' => ['post']
            ]
        ];

M
Maxim Timofeev, 2017-01-25
@webinar

those. action-s get-info and add are available to all users.

for all this *
Most likely the matter is in the absence of crfs_token

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question