问题描述
我正在关注一个 HttpClient4.4 的例子,它是https://hc.apache.org/httpcomponents-client-4.4.x/httpclient-win/examples/org/apache/http/examples/client/win/ClientWinAuth.java
I'm following a example of HttpClient4.4, which is https://hc.apache.org/httpcomponents-client-4.4.x/httpclient-win/examples/org/apache/http/examples/client/win/ClientWinAuth.java
然而,这个类不能被编译,因为没有找到 WinHttpClients.我确定我导入的库是 4.4.那么,有没有人知道这是怎么回事?(我已经检查了我的类路径.仍然没有找到这个类.)
However, this class cannot be compiled, because of NOT FOUND WinHttpClients.I'm sure that the lib I imported is 4.4. So, is there anyone knows what's going on? (I have already checked my classpath. Still not found this class also.)
谢谢
推荐答案
Windows 特定作为单独的模块提供.确保将 httpclient-win
作为依赖项添加到您的项目
Windows specific is shipped as a separate module. Make sure to add httpclient-win
as a dependency to your project
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient-win</artifactId>
<version>4.4</version>
</dependency>
这篇关于HttpClient 中的 WinHttpClients 在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!