Error HttpClient cannot be resolved to a type

Mubashir Ali picture Mubashir Ali · Feb 7, 2014 · Viewed 27.6k times · Source

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.

Answer

Sotirios Delimanolis picture Sotirios Delimanolis · Feb 7, 2014

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.