Search code examples
javaapachehttpyql

Error HttpClient cannot be resolved to a type


here is the snapshot of the code

I am trying to use http request and response method but i am getting error that

The import org.apache.commons cannot be resolved

i have included httpcore.jar, httpclient.jar, httpmime.jar but yet i am getting error.


Solution

  • You've imported versions 4.3+ of the libraries but are trying to use the old HTTP commons classes (version 3?), ie GetMethod.

    The HttpClient is in package org.apache.http.client. The new version of GetMethod is HttpGet.

    It's all here.