This commit is contained in:
Looly 2022-01-07 20:50:42 +08:00
parent 506a8c2d3c
commit fd8cbfa1c9
2 changed files with 17 additions and 1 deletions

View File

@ -167,7 +167,7 @@
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.0.204</version>
<version>2.0.206</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -68,4 +68,20 @@ public class UploadTest {
HttpResponse httpResponse = httpRequest.execute();
Console.log(httpResponse);
}
@Test
@Ignore
public void smmsTest(){
// https://github.com/dromara/hutool/issues/2079
// hutool的user agent 被封了
String token = "test";
String url = "https://sm.ms/api/v2/upload";
String result = HttpUtil.createPost(url)
.header(Header.USER_AGENT, "PostmanRuntime/7.28.4")
.auth(token)
.form("smfile", FileUtil.file("d:/test/qrcodeCustom.png"))
.execute().body();
Console.log(result);
}
}