tag:blogger.com,1999:blog-1009906358192638154.post2487606827158375162..comments2024-01-02T07:11:56.801+00:00Comments on Mundane Musings: Android - Get body of HTTP Response as StringAnonymoushttp://www.blogger.com/profile/06453119270643853541noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-1009906358192638154.post-37292894226942430372013-01-24T10:04:53.234+00:002013-01-24T10:04:53.234+00:00The code uses a well used java library for reading...The code uses a well used java library for reading an HTTP Response Body into a String. As for performance, it is fast and efficient. It isn't doing anything special here, it is just a convenience method to save you re-writing the underlying code yourself.<br /><br />If you are interested at seeing the underlying implementation, see http://hc.apache.org/httpcomponents-core-ga/httpcore/clover/org/apache/http/util/EntityUtils.html<br /><br />As for "mysql based php web site" - it doesn't matter what is used on the server-side; this article is only in regards to the client consuming from that server. <br />Anonymoushttps://www.blogger.com/profile/06453119270643853541noreply@blogger.comtag:blogger.com,1999:blog-1009906358192638154.post-81291825418221020952013-01-24T09:50:51.432+00:002013-01-24T09:50:51.432+00:00is it fast enough to integrate on a working mysql ...is it fast enough to integrate on a working mysql based php web siteAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1009906358192638154.post-16082699182398077602012-04-12T17:00:48.884+01:002012-04-12T17:00:48.884+01:00Also to note, you might want to skip that url alto...Also to note, you might want to skip that url altogether and POST straight to http://www.siirretytnumerot.fi/QueryServlet. The page you mention will take you to a page containing a form; I'm guessing here but I imagine you want to skip the form and go straight to the results?<br /><br />You will need to post the parameters that would have gotten set using the form on the url you mention above.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1009906358192638154.post-80708460774405426742012-04-12T16:56:31.493+01:002012-04-12T16:56:31.493+01:00Getting the website back in HTML format is actuall...Getting the website back in HTML format is actually expected in this case. It doesn't look like the site is designed to return you anything else. In other words, what you are likely doing is performing a GET on the url, which is likely going to result in the server giving you content back as if you were a regular browser accessing that url (so you get back HTML).<br /><br />If you own the server, you can modify the response to give back different types to different clients, based on the client's Accept http header.<br /><br />If you don't own the site, then you will have to deal with parsing the HTML to get what you need I'm afraid.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1009906358192638154.post-46250623714211848582012-03-22T19:01:29.342+00:002012-03-22T19:01:29.342+00:00Nice code.
I have been trying to apply your code t...Nice code.<br />I have been trying to apply your code to this website but am getting the whole source code for the website whereas I just need to identify the mobile number network operator. Please can you help me check the site and tell me how i can get the output I desire using your code?<br />The url is http://www.siirretytnumerot.fi/index.html?clientLanguage=engiwyz80https://www.blogger.com/profile/15550792134227635445noreply@blogger.com