<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國際加速解決方案。 廣告
                # HTTP 簡單使用 * Http請求使用 * Api請求使用 #### 首先引用配置 ```java <dependency> <groupId>epii.base</groupId> <artifactId>http</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> ``` 在java中使用,可以有get,post.使用post傳參時,使用PostData類型傳參,可以傳多個參數; 示例:post方法 ```java PostData postData = new PostData(); postData.add("token",args.params("token")); postData.add("type",args.params("type")); String post_str = Http.post("http://public.master.wanglong_xunjie.wenshi.wszx.cc/api.php?app=epii_select@options", postData); ``` 示例:get方法 ```java Args.ParamsData type = args.params("type"); String s = Http.get("http://public.master.wanglong_xunjie.wenshi.wszx.cc/api.php?app=epii_select@options&type=" + type); ``` ##### Api調用大部分post調用是使用api調用接口 Api.post 調用共有4種類型可傳 PostData類型、map類型、也可添加onConnection 可以重寫類,不過一般不會用到onConnection 。 api使用方法調用返回值為json數據 如下圖會有4種傳參數方法。 ![image-20210804141230765](https://img.kancloud.cn/10/7b/107be4732f3c4bf651e9ba8de5126d38_514x124.png) api返回常用方法類型。當然還有其它類型,就不一 一列舉了 | 方法 | 含義 | | ----------- | ---------------------------- | | isSuccess() | 請求成功或失敗 true or false | | getData() | 接口返回map使用 | | getArray() | 接口返回List 使用 | | getCode() | 接口返回code值 | | getMsg() | 接口返回msg 信息 | 示例: ```java PostData postData = new PostData(); postData.add("type",args.params("type")); Api.Result post_str = Api.post("http://public.master.wanglong_xunjie.wenshi.wszx.cc/api.php?app=epii_select@options", postData); System.out.println(post_str.isSuccess()); System.out.println(post_str.getArray()); ``` 返回結果示例 ```java true [ { "text": "互聯網", "value": 1 }, { "text": "電子商務", "value": 2 } ] ```
                  <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>

                              哎呀哎呀视频在线观看