| | |
| | | |
| | | /** |
| | | * Http协议客户端 |
| | | * |
| | | * @author luxiaotao |
| | | * @date 2018-9-27 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * GET请求执行 |
| | | * |
| | | * @return the HttpHandler response |
| | | */ |
| | | public String doGet() throws IOException { |
| | |
| | | |
| | | /** |
| | | * POST请求执行 |
| | | * |
| | | * @return the HttpHandler response |
| | | */ |
| | | public String doPost() throws IOException { |
| | |
| | | |
| | | /** |
| | | * get请求参数拼接方法 |
| | | * |
| | | * @return 请求行 |
| | | */ |
| | | private String paramsToUrl(String uri, String path, Map<String, Object> params, boolean isHttps) { |
| | |
| | | |
| | | /** |
| | | * 获取 okHttpClient |
| | | * |
| | | * @return the HttpHandler instance |
| | | */ |
| | | private OkHttpClient getClient(Integer timeout, TimeUnit timeUnit){ |
| | |
| | | |
| | | /** |
| | | * 建造器 |
| | | * |
| | | * @return the HttpHandler instance |
| | | */ |
| | | public HttpHandler build(){ |