<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 1、 json格式:會設置 content-type 為 application/json #### 結構體 ``` Type Teacher struct { Id int Name string Age int } ``` ~~~ func (c *OtherController) Get() { teacher := Teacher{Id: 123, Name: "zhiliao", Age: 2} c.Data["json"] = teacher //這里必須叫 json, 因為 ServeJSON() 解析 json 變量的 c.ServeJSON() } func (c *OtherController) Get() { teacher := map[string]interface{}{"code":200,"msg":"ok"} c.Data["json"] = teacher //這里必須叫 json, 因為 ServeJSON() 解析 json 變量的 c.ServeJSON() } ~~~ ## 2、xml格式:會設置 content-type 為 application/xml #### 結構體 ``` Type Person struct { Id int Name string Gender int } ``` ~~~ test_data := Person{Id:123,Name:"zhiliao",Gender:"男"} g.Data["xml"] = &test_data -----這里必須叫xml,同上 g.ServeXML() ~~~ ## 3、jsonp格式:會設置 content-type 為 application/javascript #### 結構體 ``` Type Person struct { Id int Name string Gender int } ``` ~~~ test_data := Person{Id:123,Name:"zhiliao",Gender:"男"} g.Data["jsonp"] = &test_data -----這里必須叫jsonp,同上 g.ServeJSONP() ~~~
                  <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>

                              哎呀哎呀视频在线观看