Bugfix: parsing text/* content-type fix.

Fix a typo in the parse-reponse function that prevented fetching documents with
text/* content-type.

Added a test to ensure correct behaviour when fetching documents with
text/* content-type