Search in sources :

Example 1 with HttpResponseEntity

use of com.mendmix.common.http.HttpResponseEntity in project jeesuite-libs by vakinge.

the class HttpUtilsTest method main.

public static void main(String[] args) {
    ResourceUtils.add("mendmix.httputil.provider", "httpClient");
    HttpResponseEntity entity;
    entity = HttpUtils.get("http://www.kuaidi100.com/query?type=yuantong&postid=11111111111");
    System.out.println(entity);
    String json = "{\"example\":{\"env\":\"dev\"},\"pageNo\":1,\"pageSize\":10}";
    entity = HttpUtils.postJson("http://openapi.mytest.com/api/commonlog/custom_log/list?_logType=mq_produce_logs", json);
    System.out.println(entity);
    HttpRequestEntity requestEntity = HttpRequestEntity.get("http://").basicAuth("admin", "123456");
    entity = HttpUtils.execute(requestEntity);
    System.out.println(entity);
}
Also used : HttpResponseEntity(com.mendmix.common.http.HttpResponseEntity) HttpRequestEntity(com.mendmix.common.http.HttpRequestEntity)

Aggregations

HttpRequestEntity (com.mendmix.common.http.HttpRequestEntity)1 HttpResponseEntity (com.mendmix.common.http.HttpResponseEntity)1