Issue
I want to make a persistent http connection in my android application. Since the backend responses are configured for Keep-Alive.
I would like to know how to make persistent http connections in Android in order to avoid handshake request everytime.
Solution
Set the header to include a keep-alive request.
HttpURLConnection conn = (HttpURLConnection) mURL.openConnection();
conn.setRequestProperty("Connection","Keep-Alive");
Answered By - varevarao
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.