mirror of
				https://gitee.com/dromara/hutool.git
				synced 2025-10-26 18:59:23 +08:00 
			
		
		
		
	添加测试用例testHttpResource
This commit is contained in:
		| @@ -2,6 +2,7 @@ package cn.hutool.http; | ||||
|  | ||||
| import cn.hutool.core.date.DateUtil; | ||||
| import cn.hutool.core.date.TimeInterval; | ||||
| import cn.hutool.core.io.resource.StringResource; | ||||
| import cn.hutool.core.lang.Console; | ||||
| import cn.hutool.core.net.SSLProtocols; | ||||
| import cn.hutool.core.net.url.UrlBuilder; | ||||
| @@ -240,4 +241,19 @@ public class HttpRequestTest { | ||||
| 		final HttpResponse httpResponse = HttpRequest.get("http://82.157.17.173:8100/app/getAddress").execute(); | ||||
| 		Console.log(httpResponse.body()); | ||||
| 	} | ||||
|  | ||||
| 	@Test | ||||
| 	@Ignore | ||||
| 	public void testHttpResource() { | ||||
|  | ||||
| 		HttpRequest httpRequest = HttpRequest.post("http://127.0.0.1:8080/testHttpResource"); | ||||
| 		HttpResponse response = httpRequest.form("user", new HttpResource(new StringResource("{\n" + | ||||
| 						"    \"name\": \"张三\",\n" + | ||||
| 						"    \"age\": \"16\"\n" + | ||||
| 						"}"), "application/json")) | ||||
| 				.form("passport", "12456") | ||||
| 				.execute(); | ||||
| 		Console.log(response.body()); | ||||
|  | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 wenlianggong
					wenlianggong