<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def do_req(self, method, url, body=None, headers=None, status=None):
 """Used internally to send a request to the API, left public so it can be used to talk to the API more directly. """

        if body is None:
            body = ''
        else:
            body = json.dumps(body)
        res = self.backend.dispatch_request(method=method,
                                            url=url,
                                            body=body,
                                            headers=self.get_headers(headers),
                                            auth=self.auth)
        if not isinstance(res, MapiResponse):
            res = MapiResponse(*res)
        if status is None:
            if res.status // 100 != 2:
                raise MapiError(*res)
        elif res.status != status:
            raise MapiError(*res)

        return res