Mubashir Ali
Mubashir Ali

Reputation: 559

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.

Upvotes: 8

Views: 38519

Answers (3)

AzyCrw4282
AzyCrw4282

Reputation: 7744

If anyone else stumbles upon this, check this

As mentioned by @sotirios, its been replaced by HttpGet. I set this to get it working

import org.apache.http.client.methods.HttpGet;

Upvotes: 0

coolDude
coolDude

Reputation: 417

You can download jar file from below link and import in your project

Download jar File

Upvotes: -1

Sotirios Delimanolis
Sotirios Delimanolis

Reputation: 279960

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.

Upvotes: 7

Related Questions