Skip to content

Latest commit

 

History

History
69 lines (61 loc) · 1.91 KB

README.md

File metadata and controls

69 lines (61 loc) · 1.91 KB

QuickHttp

Maven Central License

this is a java quick request http util

  • Ability to quickly create HTTP requests
  • It's very simple, but very powerful

To use Quick - Http in a library

String res = new QuickHttp()
               .url("http://www.csdn.net/")
               .get()
               .addParame("c", "iphone")
               .addHeader("uid","100")
               .addCookie("sid","100")
               .text();

If use post and more return type

byte[] res = new QuickHttp()
               .url("http://www.csdn.net/")
               .post()
               .bytes();

or return http code and cookie and data of ResponseBody

ResponseBody body = new QuickHttp()
               .url("http://www.csdn.net/")
               .post()
               .body();
int stateCode = body.getStateCode();
CookieStore cookie = body.getCookie();
String text = body.text();
String bytes = body.bytes();

Download

Maven

<dependency>
    <groupId>com.fcibook.quick</groupId>
    <artifactId>quick-http</artifactId>
    <version>1.4</version>
</dependency>

Import dependency

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>fluent-hc</artifactId>
    <version>4.4.1</version>
</dependency>
<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpmime</artifactId>
    <version>4.4.1</version>
</dependency>