def METHOD_NAME(self, method, url, compare='nocompare', code=OK, **kwargs):
    if 'data' in kwargs and isinstance(kwargs['data'], dict):
        kwargs['data'] = dump(kwargs['data'])
    r = getattr(requests, method)(server.base_url + url, timeout=1, **kwargs)
    self.assertEqual(r.status_code, code, f'{url}: code {r.status_code} != {code}')
    if compare != 'nocompare':
        self.assertEqual(METHOD_NAME.loads(r.text), compare)
    return r