
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
cn.microanswer:HttpUtil
Advanced tools
This is a network request tool class. Base on the okhttp project. All the methods in this tool class are synchronous. Asynchronous support is not part of the network request category. You may need to handle the asynchronous problem on your own.
网络请求工具,一个方法完成网络请求。本工具是依赖于 okhttp 进行的再一次封装,使每次网络请求代码更精简。欢迎大家提交issues或反馈bug及建议到 Microanswer邮箱
#注意:本工具类里所有方法均为同步方法。
支持:\
<dependency>
<groupId>cn.microanswer</groupId>
<artifactId>HttpUtil</artifactId>
<version>1.1.0</version>
</dependency>
compile group: 'cn.microanswer', name: 'HttpUtil', version: '1.1.0'
// 使用 Get 请求
String responseString = HttpUtil.get("http://microanswer.cn");
// 下载文件到 指定目录
File downloadedFile = HttpUtil.download("http://microanswer.cn", new File("D:/"));
// 提交 POST 表单请求
HttpUtil.postFormUrlEncode("http://microanswer.cn/", null);
// 提交 POST JSON请求
HttpUtil.postApplicationJson("http://microanswer.cn/api/common.php", (JSONObject) null);
// 上传文件到指定url
HttpUtil.upload("http://microanswer.cn", new File("D:/test.mp3"));
// 如果只有一个文件, 则该文件的表单name是:file
// 多个文件
HttpUtil.upload("http://microanswer.cn", new File("D:/test.mp3"), new File("D:/test1.mp3"), new File("D:/test2.mp3"));
// 如果有多个文件,则第一个文件的表单name是:file,往后依次:file1, file2,file3,...
// 更复杂的请求可通过:
HttpUtil.post(url, contentType, bodyBytes, headers);
// 关闭日志记录
HttpUtil.LOG = false;
FAQs
This is a network request tool class. Base on the okhttp project. All the methods in this tool class are synchronous. Asynchronous support is not part of the network request category. You may need to handle the asynchronous problem on your own.
We found that cn.microanswer:HttpUtil demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.