dousidan1279 2015-07-23 03:13
浏览 736
已采纳

Laravel 5只能从请求获得GET或POST参数

I can access request params using Request::input() or Request::all().

The problem is that my request includes both GET and POST params, but only GET ones are used to calculate signature.

Is there a way to retrieve only a set of GET or a set of POST params from request in Laravel 5.1?

Or going with $_GET and $_POST is my only option here?

Thank you.

  • 写回答

3条回答 默认 最新

  • doumu5934 2015-07-23 03:23
    关注

    You can use Request::query() to get only GET parameters. Keep in mind that there are no guaranties about consistency in the order of parameters you get from GET, so you might need to sort the array before calculating the signature - depending on how you calculate the signature.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)
编辑
预览

报告相同问题?