Skip to content

Latest commit

 

History

History
48 lines (38 loc) · 970 Bytes

README.md

File metadata and controls

48 lines (38 loc) · 970 Bytes

ExHttp

A lightweight URLConnection HTTP wrapper library for android.

Usage

Bintray

compile 'io.chengguo.android:ExHttp:1.1.0'

Sample

//Sync
ExHttp.get()
      .url("http://httpbin.org/get")
      .addQuery("k1", "v1")
      .addHeader("hello", "world")
      .build()
      .execute();

//Async
IHttpRequestCallback callback = 
        new IHttpRequestCallback() {
            @Override
            public void onStart() {
            }

            @Override
            public void onSuccess(Response response) {
            }

            @Override
            public void onError(Exception e) {
            }

            @Override
            public void onFinish() {
            }
        };
ExHttp.get()
      .url("http://httpbin.org/kkkkk")
      .addQuery("q1", "qv1")
      .build()
      .execute(callback);