Skip to content

wanaright10/simple_http_request

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

simple_http_request

最简单的HttpRequest请求

实例: GET

    Map<String, String> queryParam = new HashMap<>();
    queryParam.put("key", "value");
    queryParam.put("chinese", "中文");

    HttpResponse response = HttpRequest.create()
            .get("http://domain:port/some/path", queryParam, true)//也可以不传 也可以不加密
            .execute();

    int responseCode = response.getCode();
    String responseStr = response.getBody();

POST

    Map<String, String> queryParam = new HashMap<>();
    queryParam.put("key", "value");
    queryParam.put("chinese", "中文");

    HttpResponse response = HttpRequest.create()
            .post("http://domain:port/some/path", queryParam, true)//也可以不传 也可以不加密
            .execute();

    int responseCode = response.getCode();
    String responseStr = response.getBody();

About

最简单的HttpRequest请求

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages