简体   繁体   中英

java HttpClient-4.1.2 jar

i am using httpclient-4.1.2 jar file in my project,and write code:

HttpClient client = new DefaultHttpClient();

but its throwing an exception

Exception in thread "main" java.lang.VerifyError: (class: org/apache/http/impl/client/DefaultHttpClient, method: setDefaultHttpParams signature: (Lorg/apache/http/params/HttpParams;)V) Incompatible argument to function

You have to have the other jars for the httpclient as well (httpcore for example, a lots of the apache commons as well).

The parameter "HttpParams" is in fact an interface which needs to be sent as parameter to setDefaultHttpParams .

Are you constructing this and is it being sent? In order to send it, you need to have some other jar, and this is the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM