Hi
I'm not getting any response from below line.

response = cliente.execute(post);

On Wed, May 18, 2011 at 5:54 PM, Diogo Salaberri <[email protected]> wrote:

> // Create a default client HTTP
> DefaultHttpClient cliente = new DefaultHttpClient();
>
> // Set post or get method and set the URL
> HttpPost post = new HttpPost("URL");
>
> // Here you can set a parameter,
> post.addHeader("Name", "Value");
>
> // When you receive a response, you need to get this in a TRY/CATCH
> try{
> response = cliente.execute(post);
>         HttpEntity entity = response.getEntity();
> Out = EntityUtils.toString(entity);
> }catch (Exception e) {
>         // Do something with your exception
> }
>
> One more thing, if want to receive a JSON object, just use ( object =
> (JSONObject) new JSONTokener(Out).nextValue(); ).. Cutting extra caracters
> that isn't a JSON.
>
> I hope can you enjoy this.. see you.
>
> --
> Atenciosamente;
> Diogo Bonoto Salaberri
> Bacharel em Ciência da Computação - UFPel
>
>  --
> 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
>



-- 
Thanks & Regards

Rakesh Kumar Jha
Software Developer
Symphony Services Corp (India) Pvt Ltd
Bangalore
(O) +918030274295
(R) +919886336619

-- 
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