Added None check in extract_mime_type()
Expanded the list of HTTP status codes with no content
Handle unparseable XML or JSON

If JSON or XML response entity cannot be parsed, print an error to
stderr and print the raw response text.