Lisa Anne
Lisa Anne

Reputation: 4595

How to transform this HttpPost into an Url

I have the following code that I would like to transform into a simple single URL so that (possibly) I can use Picasso for downloading images:

HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(Constants.GET_OTHER_PROFILE_PICTURE_URL);
nameValuePairs.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
UrlEncodedFormEntity form = new UrlEncodedFormEntity(nameValuePairs);
httppost.setEntity(form);

Upvotes: 0

Views: 65

Answers (1)

Jackie
Jackie

Reputation: 23597

With a GET requests the parameters can be declared in the url like

<url>?<entry.getKey>=<entry.getValue>

The same parameters (as key value pairs separated by a colon) are passed to a POST request through the body.

Upvotes: 1

Related Questions