Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 726
Mubashir Ali Avatar asked Feb 07 '14 15:02

Mubashir Ali


1 Answers

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.

like image 66
Sotirios Delimanolis Avatar answered Sep 19 '22 15:09

Sotirios Delimanolis