thanks for reply,

it is working now, i was tring to add header before it get initialised

it should be lilke that

method = new HttpGet( new URI(url) );
method.addHeader("Connection","Keep-Alive");

On Mar 26, 1:15 pm, Stoyan Damov <[email protected]> wrote:
> What happens if you do this instead:
>
> method.getParams().setParameter("http.useragent", this.user_agent_id);
>
> ?
>
> On Thu, Mar 26, 2009 at 2:54 PM, zeeshan <[email protected]> wrote:
>
> > Hi Experts,
>
> > i am trying to add header on HttpGet but it raise this exception
> > "InvocationTargetException"
>
> > here is my code:
>
> > DefaultHttpClient client = new DefaultHttpClient();
> >            HttpGet method = null;
> >            HttpResponse resp = null;
>
> > String url = "http://www.x.com/a.xml";;
>
> >        method.addHeader("Connection","Keep-Alive");
> >        /*method.addHeader("accept-language",this.accept_language);
> >        method.addHeader("user-agent-id",this.user_agent_id);*/
>
> >        method = new HttpGet( new URI(url) );
>
> > i also used setHeader but same error
>
> > please help me out
--~--~---------~--~----~------------~-------~--~----~
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