When a query produces an invalid query string, the API returns a plain
text error message. These were being converted into bytes and then
tried to parse as JSON which was failing and returned the cryptic error
message TypeError: argument of type 'int' is not iterable.
When the API returns valid results it uses an application/json content
type, so check the content type of the response and if it's text/html
raise an error and display the API error message to the user.
When a query produces an invalid query string, the API returns a plain text error message. These were being converted into bytes and then tried to parse as JSON which was failing and returned the cryptic error message
TypeError: argument of type 'int' is not iterable
.When the API returns valid results it uses an
application/json
content type, so check the content type of the response and if it'stext/html
raise an error and display the API error message to the user.Mostly addresses #18