-6

Can anyone tell me difference between Httpost and Httpget method.Httpclient can execute POST and GET method.Please explain the difference between 1 and 2nd method

1.)httpclient.execute(httppost)

and the other one

2.) httpclient.execute(httpget)

kumar kundan
  • 1,857
  • 1
  • 23
  • 36
SREEJITH
  • 816
  • 1
  • 8
  • 18
  • 3
    Really, this isn't an [tag:android] question at all. You might find it useful to research the difference between GET and POST - there are *hundreds of thousands of simple explanations* via Google. – Jimbo Mar 13 '13 at 15:19
  • 1
    Duplicates: http://stackoverflow.com/q/3970555/1409082 http://stackoverflow.com/q/3477333/1409082 http://stackoverflow.com/q/4130646/1409082 http://stackoverflow.com/q/3477333/1409082 http://stackoverflow.com/q/5802343/1409082 http://stackoverflow.com/q/2296395/1409082 http://stackoverflow.com/q/504947/1409082 http://stackoverflow.com/q/4668701/1409082 – Jocelyn Mar 15 '13 at 17:12

2 Answers2

9

In Http Get Method all the values that user sends to the server, embedded with the URL that we send as the request, where a third party can easily watch it. If I say it more technical way, by using the HTTP GET method, we are sending user details in the header part of the request not in the body.

source

Where as in Http Post method we transfer confidential data to a different location by using HTTP. The reason is the content goes inside the body, not with the header as in GET method.

source

You can also refer android developers website

Sumit Sharma
  • 1,759
  • 21
  • 25
2

The Apache HTTP Client supports all the commands that are supported by HTTP, such as GET, PUT, POST, DELETE, TRACE, OPTIONS & HEAD.

Most well-known are GET & POST, where GET is used to fetch a resource from the URL and POST is used to store data at a URL. There are official ways in how the different methods should be used, especially when creating a REST API, but in real life most boil down to the GET and the POST.

For a full discussion of the different methods you can read RFC2616 describing the HTTP: http://www.faqs.org/rfcs/rfc2616.html

M. le Rutte
  • 3,364
  • 3
  • 15
  • 28