I'm not 100% sure I understand the question either.... but just in case...this does it for a Post... and switching to a Get will do the same thing.

HttpPost httpPost = new HttpPost(urlString);
List<NameValuePair> nvps = new ArrayList<NameValuePair>();

nvps.add(new BasicNameValuePair("akey", "avalue"));

httpPost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));

If you check the Request on your server after you send it.. you will see the normal "?key=value" strings.

Sincerely,

Brad Gies
-----------------------------------------------------------------------
Bistro Bot - Bistro Blurb
http://bgies.com            http://nocrappyapps.com
http://bistroblurb.com      http://forcethetruth.com
http://ihottonight.com
-----------------------------------------------------------------------
Everything in moderation, including abstinence (paraphrased)

Every person is born with a brain... Those who use it well are the successful 
happy ones - Brad Gies

Adversity can make or break you... It's your choice... Choose wisely - Brad Gies

Never doubt that a small group of thoughtful, committed people can
change the world. Indeed. It is the only thing that ever has - Margaret Mead


On 07/01/2011 5:08 PM, John Lussmyer wrote:
I don't think you understood my question.
Given a list of key-value pairs, is there a utility class to build the "?key=value&key=value&key=value...." string.

On Fri, Jan 7, 2011 at 3:00 PM, Mark Murphy <[email protected] <mailto:[email protected]>> wrote:

    On Fri, Jan 7, 2011 at 5:40 PM, John Lussmyer
    <[email protected] <mailto:[email protected]>> wrote:
    > Does one of the HTTP support classes handle building a
    parameterized URL?
    > i.e one of the sort http://a.com/stuff?a=b&c=d&e=f
    <http://a.com/stuff?a=b&c=d&e=f>
    >
    > Yes, I know writing one would be easy, but if there is already
    one out
    > there...

    http://developer.android.com/reference/java/net/URLEncoder.html


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to