File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed
main/java/io/github/admin4j/http Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,11 @@ public HttpRequest method(Method method) {
9090 return this ;
9191 }
9292
93+ public HttpRequest mediaType (MediaTypeEnum mediaType ) {
94+ this .mediaType = mediaType ;
95+ return this ;
96+ }
97+
9398 public HttpRequest userAgent (String userAgent ) {
9499 if (headers == null ) {
95100 headers = new HashMap <>(8 );
Original file line number Diff line number Diff line change @@ -24,21 +24,21 @@ void getStr() throws IOException {
2424
2525 HttpConfig .ProxyConfig proxyConfig = new HttpConfig .ProxyConfig ();
2626 proxyConfig .setHost ("119.8.115.201" );
27- proxyConfig .setPort (9892 );
28- proxyConfig .setUserName ("ces " );
29- proxyConfig .setPassword ("iIl1o0O " );
27+ proxyConfig .setPort (9898 );
28+ proxyConfig .setUserName ("ces_order " );
29+ proxyConfig .setPassword ("23451Order " );
3030 httpConfig .setProxy (proxyConfig );
3131
3232 OkHttpClient okHttpClient = HttpClientFactory .okHttpClient (httpConfig );
3333
3434 ApiJsonClient apiClient = new ApiJsonClient (httpConfig );
3535 // apiClient.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36");
36- //JSONObject jsonObject = apiClient.get("https://2022.ip138.com/");
36+ // JSONObject jsonObject = apiClient.get("https://2022.ip138.com/");
3737
3838 Map <String , Object > formParams = new HashMap <>(16 );
3939 formParams .put ("username" , "admin" );
4040 formParams .put ("password" , "admin123" );
41- JSONMapper object = apiClient .postForm ("https://www.baidu .com/? /auth/login " ,
41+ JSONMapper object = apiClient .get ("https://api.onbuy .com/v2 /auth/request-token " ,
4242 formParams
4343 );
4444 System .out .println ("post = " + object );
Original file line number Diff line number Diff line change 1818 <properties >
1919 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
2020 <java .version>1.8</java .version>
21- <revision >0.8.1 </revision >
21+ <revision >0.9.0 </revision >
2222 </properties >
2323
2424 <build >
You can’t perform that action at this time.
0 commit comments