android - HTTPResponse handling invalid content type -



android - HTTPResponse handling invalid content type -

i have below code :

httpget httpget = new httpget(params[0] + params[1]); httpget.setheader("content-type", "application/json"); httpget.setheader("accept", "application/json"); httpresponse = httpclient.execute(httpget); if (httpresponse != null) { // }

as can see content-type application/json.

but receive content-type text/html, need check if response application/json process.we can have equalsignorecase check looking improve solution.

android json http httpresponse content-type

Comments

Popular posts from this blog

php - How to pass multiple values from url -

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

database - php search bar when I press submit with nothing in the search bar it shows all the data -