def request(method, path, params=None, data=None, auto_retry=True):
body = None<EOL>if data is not None:<EOL><INDENT>body = json.dumps(data, cls=utils.DateTimeEncoder)<EOL><DEDENT>headers = {<EOL>'<STR_LIT>': '<STR_LIT:application/json>',<EOL>'<STR_LIT>': '<STR_LIT:application/json>',<EOL>'<STR_LIT>': analyzere.user_agent,<EOL>}<EOL>resp = request_raw(method, path, params=params, body=body, headers=headers,<EOL>auto_retry=auto_retry)<EOL>content = resp.text<EOL>if content:<EOL><INDENT>try:<EOL><INDENT>content = json.loads(content, cls=utils.DateTimeDecoder)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise errors.ServerError('<STR_LIT>'<EOL>'<STR_LIT>', resp, resp.status_code)<EOL><DEDENT><DEDENT>return content<EOL>
method - HTTP method. e.g. get, put, post, etc.
path - Path to resource. e.g. /loss_sets/1234
params - Parameter to pass in the query string
data - Dictionary of parameters to pass in the request body