Re: [android-developers] HTTP parameter question

2011-01-09 Thread Brad Gies

Ok.. have you looked at UrlEncodedFormEntity ?

Sincerely,

Brad Gies
---
Bistro Bot - Bistro Blurb
http://bgies.comhttp://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:32 PM, John Lussmyer wrote:
Except that you can't setEntity() on an HttpGet - which is what I need 
to use.


On Fri, Jan 7, 2011 at 5:27 PM, Brad Gies > wrote:


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 nvps = new ArrayList();

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.


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] HTTP parameter question

2011-01-07 Thread John Lussmyer
Quite possibly, but if there is a "standard" one that comes with the system,
i'd rather use.
Since it appears that there isn't one, I'll write one.

On Fri, Jan 7, 2011 at 7:42 PM, TreKing  wrote:

> On Fri, Jan 7, 2011 at 4:40 PM, John Lussmyer wrote:
>
>> Yes, I know writing one would be easy, but if there is already one out
>> there...
>
>
> Not only is it easy - you could have written it by now. Hell you could have
> written it faster than your original email =P
>

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

Re: [android-developers] HTTP parameter question

2011-01-07 Thread TreKing
On Fri, Jan 7, 2011 at 4:40 PM, John Lussmyer wrote:

> Yes, I know writing one would be easy, but if there is already one out
> there...


Not only is it easy - you could have written it by now. Hell you could have
written it faster than your original email =P

-
TreKing  - Chicago
transit tracking app for Android-powered devices

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

Re: [android-developers] HTTP parameter question

2011-01-07 Thread John Lussmyer
Except that you can't setEntity() on an HttpGet - which is what I need to
use.

On Fri, Jan 7, 2011 at 5:27 PM, Brad Gies  wrote:

> 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 nvps = new ArrayList();
>
> 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.
>

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

Re: [android-developers] HTTP parameter question

2011-01-07 Thread Brad Gies
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 nvps = new ArrayList();

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.comhttp://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 > wrote:


On Fri, Jan 7, 2011 at 5:40 PM, John Lussmyer
mailto:johnlussm...@gmail.com>> 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

>
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] HTTP parameter question

2011-01-07 Thread John Lussmyer
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  wrote:

> On Fri, Jan 7, 2011 at 5:40 PM, John Lussmyer 
> 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
> >
> > 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] HTTP parameter question

2011-01-07 Thread Mark Murphy
On Fri, Jan 7, 2011 at 5:40 PM, John Lussmyer  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
>
> 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

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.4 Available!

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


[android-developers] HTTP parameter question

2011-01-07 Thread John Lussmyer
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

Yes, I know writing one would be easy, but if there is already one out
there...

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