mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add methods
This commit is contained in:
@@ -31,7 +31,6 @@ import java.net.Proxy;
|
||||
import java.net.URLStreamHandler;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@@ -8,7 +8,7 @@ import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Rest类型请求单元测试
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
@@ -52,4 +52,16 @@ public class RestTest {
|
||||
.set("键2", "值2").toString());
|
||||
Console.log(request.execute().body());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void getWithBodyTest2() {
|
||||
HttpRequest request = HttpRequest.get("https://ad.oceanengine.com/open_api/2/advertiser/info/")//
|
||||
.setHttpProxy("localhost", 8888)
|
||||
.header("Access-Token","b91e44f37ff2544079ceabcfafaf02bd3db9b769")
|
||||
.body(JSONUtil.createObj()
|
||||
.set("advertiser_ids", new Long[] {1690657248243790L})
|
||||
.set("fields", new String[] {"id", "name", "status"}).toString());
|
||||
Console.log(request.execute().body());
|
||||
}
|
||||
}
|
||||
|
@@ -26,6 +26,7 @@ public class SimpleServerTest {
|
||||
String res = JSONUtil.createObj()
|
||||
.set("id", 1)
|
||||
.set("method", request.getMethod())
|
||||
.set("request", request.getBody())
|
||||
.toStringPretty();
|
||||
response.write(res, ContentType.JSON.toString());
|
||||
})
|
||||
|
Reference in New Issue
Block a user