# EasyHttp **Repository Path**: arrow-down/EasyHttp ## Basic Information - **Project Name**: EasyHttp - **Description**: 一个简单的http客户端 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: dev - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2018-04-28 - **Last Updated**: 2020-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # EasyHttp #### 项目介绍 一个简单的http客户端 [ ![Download](https://api.bintray.com/packages/wangzhiqiang/maven/EasyHttp/images/download.svg) ](https://bintray.com/wangzhiqiang/maven/EasyHttp/_latestVersion) ##### 使用方法 ```gradle repositories { maven { url "https://dl.bintray.com/wangzhiqiang/maven" } } dependencies{ implementation 'org.easyhttp:easyhttp-core:lastversion' } ``` ##### 使用示例 ``` java EasyClient client= new EasyClient(); Request.Builder builder= new Request.Builder(); builder.setUrl("http://127.0.0.1:8080/demo/post-form"); builder.setMethod(HttpMethod.POST); // 表单提交 FormUrlencodedBody body = new FormUrlencodedBody(); body.put("a", 123); body.put("c", "asdasd"); // 文件上传 FormDataBody body = new FormDataBody(); body.addPart("info", info); body.addPart("file", new File("xxx")); // Json GsonBody> body = new GsonBody<>(); HashMap data = new HashMap<>(); data.put("AAA", info); body.setData(data); builder.setBody(body); Request request = builder.build(); Response resp = client.execute(request); ``` [更多使用方法请看 easyhttp-demo-server](./easyhttp-demo-server)