Android making HTTP Requests - Androhub

Http Request Banner

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. :)

Post comment

Your email address will not be published. Required fields are marked *