【问题标题】:Postman localhost Authentication邮递员本地主机身份验证
【发布时间】:2014-10-13 22:50:48
【问题描述】:

我用Laravel 4 创建了一个我想测试的API,所以我使用postman。当我输入我的用户名、密码和 URL 时:

http://127.0.0.1/stores/public/locator/api/service/v1/store

一个弹出窗口显示并告诉我输入 localhost:80 的用户名和密码。我该如何解决这个问题?

这是路线

Route::resource('store', 'StoreController');

Route::filter('Apiauth', function()
{
 return Auth::basic("username");
);

Route::group(array('prefix' => 'locator/api/service/v1', 'before'=> 'Apiauth'),  function()
{
Route::resource('store', 'StoreController');
});

【问题讨论】:

    标签: api laravel postman


    【解决方案1】:

    您可以在

    中包含基本身份验证
    http://username:passwordd@www.server.com/route
    

    HTTP Basic Authentication credentials passed in URL and encryption

    【讨论】:

      猜你喜欢
      • 2015-07-26
      • 2021-07-07
      • 2017-04-15
      • 2021-09-15
      • 1970-01-01
      • 2023-03-12
      • 2021-02-05
      • 2017-02-12
      • 2021-09-01
      相关资源
      最近更新 更多