a tiny http library for android.
- Encapsulation HttpUrlConnection;
- One line code to make a http request;
- support http "get" and "post" request;
- one request with params, request type and callback;
- support String, Bitmap, Image and File request;
- Desing Pattern
- Builder
As String type:
TinyHttp.get()
.url("http://www.kuaidi100.com/query")
.priority(Priority.HIGH)
.param("type", "yuantong")
.param("postid", "803977139201993050")
.callback(new StringHttpCallBack() {
@Override
public void OnMainSuccess(String response) {
TestBean bean = toObject(response, TestBean.class);
tvConsole.setText(bean.toString());
}
@Override
public void OnMainFail(String errorMessage) {
}
})
.execute();