“慢生活”不是懒惰,放慢速度不是拖延时间,而是让我们在生活中寻找到平衡。网站首页程序人生
webman-請求-獲取cookie
发布时间:2022-01-16 22:15:01作者:雪饮
![[!--pagekey--]](/d/file/manshenghuo/chengxurensheng/7d6fc923357a7332848224c6c651d902.png)
首先服務端實現如var_dump($request->cookie('name'));那麽假如要用postman來請求該如何設置cookie一個name的cookie項呢?也不難,就是在請求最右邊點擊cookies,然後在type a d
阅读全文>>webman-請求-獲取header
发布时间:2022-01-16 21:22:22作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
获取整个header数组$request->header();如果请求没有header参数则返回一个空的数组。注意所有key均为小写。获取header数组的某一个值$request->header('host');如果header
阅读全文>>webman-請求-獲取請求參數post
发布时间:2022-01-16 21:21:49作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
和獲取請求參數get差不多的,有全獲取有單個值獲取,有單個值不存在時候的獲取,基本語法如$request->post('name');那麽這裏著重介紹的是獲取原始post請求,一般是raw數據:$post =
阅读全文>>webman-請求-獲取請求參數get
发布时间:2022-01-16 21:05:22作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
實例:<?phpnamespace app\controller;use support\Request;class User{ public function hello(Request $request) { //获取整个get数组 如果请求没有get参数
阅读全文>>webman-快速開始-簡單示例-返回視圖
发布时间:2022-01-16 20:50:53作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
返回視圖,一般同控制器路徑有對應關係,這裏以上次返回jsonp時候控制器爲例,則其對應hello方法實現如: $default_name = 'webman'; $name = $request->get('name', $
阅读全文>>