dongzhi4073 2015-11-05 05:56
浏览 45

Slim REST授权返回空

This is my function to get the headers.

 function authenticate(\Slim\Route $route ) {
    // Getting request headers
    $app = \Slim\Slim::getInstance();
    $headers = $app->request()->headers()->all();
    $response = array();

    die(var_export($headers));
  }

And what im getting on post man is

array (
    Authorization' => '',
      'Host' => 'localhost',
      'Connection' => 'keep-alive',
      'Content-Length' => '0',
      'Cache-Control' => 'no-cache',
      'Origin' => 'chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop',
      'User-Agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36     (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',
      'Postman-Token' => 'bd5e445c-bba1-b7fc-29e6-17724a83dcbd',
      'Accept' => '*/*',
      'Accept-Encoding' => 'gzip, deflate',
      'Accept-Language' => 'en-US,en;q=0.8',
    )
  • 写回答

1条回答 默认 最新

  • dongzaijiao4863 2015-11-05 06:16
    关注

    You can choose to save helper data to collection requests. This will cause the signature to be regenerated each time. These helpers will even work in Newman!

    enter image description here

    Enter the username and password fields and hit "Refresh headers" to generate the authorization header.

    Please visit POSTMAN Helpers

    Update

    For more help visit here

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据