How To Get Only String From Httpresponse Restapi Android
I have tried this code snippet to get the response from android using HTTPResponse String s=''; try { HttpClient httpClient=new DefaultHttpClient(); HttpPost httpPost=new
Solution 1:
What you need is one more line - when you become the HttpResponse it is the whole html from the response site, so you need to remove all tags from it and you could do this with a single line String responseAsText = android.text.Html.fromHtml(result).toString()
where result
is your string with the repsonse from the Httpresponse. You can add this line at the end of both codes you have provided.
Post a Comment for "How To Get Only String From Httpresponse Restapi Android"