def request_and_check(self, url, method='get',
                          expected_content_type=None, **kwargs):
        assert (method == 'get' or method == 'post')
        result = getattr(self, method)(url, **kwargs)
        if result.status_code != requests.codes.ok:
            raise RuntimeError('Error requesting %r, status = %d' %
                               (url, result.status_code))
        if expected_content_type is not None:
            content_type = result.headers.get('content-type', '')
            if not content_type.startswith(expected_content_type):
                raise RuntimeError(
                    'Error requesting %r, content type %r does not match %r' %
                    (url, content_type, expected_content_type))
        return result
Performs a request, and checks that the status is OK, and that the
dataset/ETHPy150Open mrooney/mintapi/mintapi/api.py/Mint.request_and_check