<small id='fvXo2'></small><noframes id='fvXo2'>

  • <legend id='fvXo2'><style id='fvXo2'><dir id='fvXo2'><q id='fvXo2'></q></dir></style></legend>
      <tfoot id='fvXo2'></tfoot>

          <bdo id='fvXo2'></bdo><ul id='fvXo2'></ul>

        <i id='fvXo2'><tr id='fvXo2'><dt id='fvXo2'><q id='fvXo2'><span id='fvXo2'><b id='fvXo2'><form id='fvXo2'><ins id='fvXo2'></ins><ul id='fvXo2'></ul><sub id='fvXo2'></sub></form><legend id='fvXo2'></legend><bdo id='fvXo2'><pre id='fvXo2'><center id='fvXo2'></center></pre></bdo></b><th id='fvXo2'></th></span></q></dt></tr></i><div id='fvXo2'><tfoot id='fvXo2'></tfoot><dl id='fvXo2'><fieldset id='fvXo2'></fieldset></dl></div>

        检查请求是 GET 还是 POST

        时间:2023-10-12

          <tbody id='3JZwQ'></tbody>

        • <tfoot id='3JZwQ'></tfoot>

              <small id='3JZwQ'></small><noframes id='3JZwQ'>

                <legend id='3JZwQ'><style id='3JZwQ'><dir id='3JZwQ'><q id='3JZwQ'></q></dir></style></legend>
                <i id='3JZwQ'><tr id='3JZwQ'><dt id='3JZwQ'><q id='3JZwQ'><span id='3JZwQ'><b id='3JZwQ'><form id='3JZwQ'><ins id='3JZwQ'></ins><ul id='3JZwQ'></ul><sub id='3JZwQ'></sub></form><legend id='3JZwQ'></legend><bdo id='3JZwQ'><pre id='3JZwQ'><center id='3JZwQ'></center></pre></bdo></b><th id='3JZwQ'></th></span></q></dt></tr></i><div id='3JZwQ'><tfoot id='3JZwQ'></tfoot><dl id='3JZwQ'><fieldset id='3JZwQ'></fieldset></dl></div>

                • <bdo id='3JZwQ'></bdo><ul id='3JZwQ'></ul>
                  本文介绍了检查请求是 GET 还是 POST的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在我的控制器/动作中:

                  In my controller/action:

                  if(!empty($_POST))
                  {
                      if(Auth::attempt(Input::get('data')))
                      {
                          return Redirect::intended();
                      }
                      else
                      {
                          Session::flash('error_message','');
                      }
                  }
                  

                  Laravel 中是否有检查请求是POST 还是GET 的方法?

                  Is there a method in Laravel to check if the request is POST or GET?

                  推荐答案

                  我已经在 laravel 版本中解决了如下问题:7+

                  I've solve my problem like below in laravel version: 7+

                  **In routes/web.php:**
                  Route::post('url', YourController@yourMethod);
                  
                  **In app/Http/Controllers:**
                  public function yourMethod(Request $request) {
                      switch ($request->method()) {
                          case 'POST':
                              // do anything in 'post request';
                              break;
                  
                          case 'GET':
                              // do anything in 'get request';
                              break;
                  
                          default:
                              // invalid request
                              break;
                      }
                  }
                  

                  这篇关于检查请求是 GET 还是 POST的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 Zend 框架处理输入(Post、get 等) 下一篇:带有 GET 请求的 PHP 开关

                  相关文章

                  1. <tfoot id='6KOj2'></tfoot>

                    <small id='6KOj2'></small><noframes id='6KOj2'>

                      <bdo id='6KOj2'></bdo><ul id='6KOj2'></ul>

                  2. <i id='6KOj2'><tr id='6KOj2'><dt id='6KOj2'><q id='6KOj2'><span id='6KOj2'><b id='6KOj2'><form id='6KOj2'><ins id='6KOj2'></ins><ul id='6KOj2'></ul><sub id='6KOj2'></sub></form><legend id='6KOj2'></legend><bdo id='6KOj2'><pre id='6KOj2'><center id='6KOj2'></center></pre></bdo></b><th id='6KOj2'></th></span></q></dt></tr></i><div id='6KOj2'><tfoot id='6KOj2'></tfoot><dl id='6KOj2'><fieldset id='6KOj2'></fieldset></dl></div>

                    1. <legend id='6KOj2'><style id='6KOj2'><dir id='6KOj2'><q id='6KOj2'></q></dir></style></legend>