Bug 1248944 - Add a User Agent to requests made to Treeherder
Bug 1248944 - Add a User Agent to requests made to Treeherder

In bug 1230222 we're encouraging consumers of Treeherder's API to set
user agent:
https://bugzilla.mozilla.org/show_bug.cgi?id=1230222

As part of the refactoring to do this, I've removed `verify=True` since
it's set to True by default:
http://docs.python-requests.org/en/latest/user/advanced/#ssl-cert-verification

The `accept-encoding: gzip` header is also unnecessary, since requests
adds it by default:
https://github.com/kennethreitz/requests/blob/v2.9.1/requests/utils.py#L588

I've removed the `SSLError` try-catch, since there should not be
problems verifying Treeherder's certificate. If there are, we shouldn't
ignore them.

I've also added raise_for_status(), which raises if the status code is
not 200. This shouldn't cause anything to fail that wouldn't have done
already (since the json decode would have previously raised anyway),
however at least now the root cause will be clearer. I'm happy to add
try-except handling of that if you'd rather requests to fail more
gracefully than they did previously.

It's also unclear why the html version of pushlog is being scraped,
since there is a json version available - so I've added a TODO so this
can be investigated later.

dminor/ouija,jmaher/ouija,dminor/ouija,jmaher/ouija,dminor/ouija,jmaher/ouija