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

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

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -