Backbone を Yii に統合しようとしているため、REST が必要です。そこで、リクエストに渡す必要があるユーザー名とパスワードを使用するYii 拡張機能restfullyiiをインストールしました。問題は、バックボーンでこれを行う方法がわからないことです。
希望するリクエストの例:
List
curl -i -H "Accept: application/json" -H "X_REST_USERNAME: admin@restuser" -H "X_REST_PASSWORD: admin@Access" http://yii-tester.local/api/sample/
curl -i -H "Accept: application/json" -H "X_REST_USERNAME: admin@restuser" -H "X_REST_PASSWORD: admin@Access" http://yii-tester.local/api/sample/limit/1
curl -i -H "Accept: application/json" -H "X_REST_USERNAME: admin@restuser" -H "X_REST_PASSWORD: admin@Access" http://yii-tester.local/api/sample/limit/10/5 (limit/offeset)
完全に理にかなっている現在のエラー応答..:
{
"success": false,
"message": "You are not authorized to proform this action.",
"data": {"errorCode":500}
}
バックボーン全体でそのような値を送信する方法を知っている人はいますか?