java - how to check if a response is in xml format instead of HTML? -
java - how to check if a response is in xml format instead of HTML? -
im working server sends me xml responds. when server lack or reports me sending me html page (it html page informing error) didn't expect , xml parser crashed. im using defaulthttpclient() , send header mhttprequest.setheader("accept", "text/xml"); proper way ensure got xml (or other specific format) response?
as kristian suggested, see if provides different content-type when html emitted. failing check <?xml... line, apposed doctype or whatever on html page.
java android xml http
Comments
Post a Comment