File tree Expand file tree Collapse file tree
hutool-http/src/test/java/cn/hutool/http Expand file tree Collapse file tree Original file line number Diff line number Diff line change 167167 <dependency >
168168 <groupId >com.h2database</groupId >
169169 <artifactId >h2</artifactId >
170- <version >2.0.204 </version >
170+ <version >2.0.206 </version >
171171 <scope >test</scope >
172172 </dependency >
173173 <dependency >
Original file line number Diff line number Diff line change @@ -68,4 +68,20 @@ public void uploadTest2() {
6868 HttpResponse httpResponse = httpRequest .execute ();
6969 Console .log (httpResponse );
7070 }
71+
72+ @ Test
73+ @ Ignore
74+ public void smmsTest (){
75+ // https://github.com/dromara/hutool/issues/2079
76+ // hutool的user agent 被封了
77+ String token = "test" ;
78+ String url = "https://sm.ms/api/v2/upload" ;
79+ String result = HttpUtil .createPost (url )
80+ .header (Header .USER_AGENT , "PostmanRuntime/7.28.4" )
81+ .auth (token )
82+ .form ("smfile" , FileUtil .file ("d:/test/qrcodeCustom.png" ))
83+ .execute ().body ();
84+
85+ Console .log (result );
86+ }
7187}
You can’t perform that action at this time.
0 commit comments