<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ## 1、獲取url上的參數,?后面的 :[http://127.0.0.1:8090/user/?id=111](http://127.0.0.1:8090/user/?id=111) GetString獲取數據: ? 路由: ~~~ beego.Router("/user", &controllers_user.UserController{}) ~~~ 訪問路徑:http://127.0.0.1:8090/user/?id=111 獲取數據: ``` ? ? ? id := c.Input().Get("id") ? ? ? id2 := c.GetString("id") ``` ? ? ? ? 這種方式不行: ? ? ? ? ? id3 := c.Ctx.Input.Param(":id") ## 2、獲取url上的參數,/:id的 : [http://127.0.0.1:8090/user/111](http://127.0.0.1:8090/user/111) ## 路由:**/user/?:id:int** ``` beego.Router("/user/?:id:int", &controllers_user.UserController{}) ``` 訪問路徑:http://127.0.0.1:8090/user/111 獲取數據: ``` id := c.GetString(":id") id2 := c.Ctx.Input.Param(":id") ``` ? 這種方式不行了: id3 := c.Input().Get(":id") ## 3、獲取請求信息: ~~~ this.Ctx.Request ? ? ? ? ? ? ? 所有的請求信息 this.Ctx.Request.Header ? ? ? ? 請求頭 this.Ctx.Request.Host ? ? ? ? ? 請求的主機 this.Ctx.Request.Method ? ? ? ? 請求的方法 ~~~ ## 4、獲取form表單數據: ``` GetString(key string) string GetStrings(key string) []string GetInt(key string) (int64, error) ? ? ? ? --返回兩個值 GetBool(key string) (bool, error) ? ? ? ? --返回兩個值 GetFloat(key string) (float64, error) ? ? --返回兩個值 ``` ?? 舉例:前端form表單: ? ``` <form action="/user" method="post"> {{ .xsrfdata }} ? 年齡1:<input type="text" name="age"><br> ? 姓名1:<input type="text" name="name"><br> ? 地址:<input type="text" name="addr"><br> ? 姓名2:<input type="text" name="name"><br> ? 年齡2:<input type="text" name="age"><br> ? 是:<input type="radio" name="is_true" value="true"> ? 否:<input type="radio" name="is_true" value="false"><br> ? 價格:<input type="text" name="price"><br> ? <input type="submit" value="提交"><br> </form> ``` ?獲取數據:? ``` name := c.Input().Get("name") 獲取的是第一個name的值 names := c.GetStrings("name") ? 獲取所有的name的值,是個數組 age := c.Input().Get("age") age,_ := c.GetInt64("age") is_true , _ := c.GetBool("is_true") price , _ := c.GetFloat("price") ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看