Android making HTTP Requests

Android making HTTP Requests

In most of the android applications it is essential that app may need to connect to internet and make some HTTP requests. In this tutorial i’ll be demonstrating about making simple HTTP Requests/Calls in Android.

There are several steps in HTTP Requests. So read all steps one by one :

1. HTTP POST

  • Creating HTTP Post  :  HTTP Post is used if we have to post some data to server.
  • URL Encoding POST data : Before making HTTP request you need to encode the post data in order to convert all string data into valid url format.
  • Making HTTP Request via Http Response : Now you need to execute httpPost using the httpClient created before.

2. HTTP GET

  • Creating HTTP Get :  Http Get is used to fetch data from server.
  • Making HTTP Request via Http Response : Now you need to execute httpPost using the httpClient created before.
  • Making HTTP Entity : An entity that can be sent or received with an HTTP message.
  • Finally getting EntityUtils :  This string variable contains Json data that can be parsed.
 

Finally, you are ready to work on HTTP Requests.

Thanks. :)

Leave a Comment

Comment (required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Name (required)
Email (required)