kitir/kits/restful_api.py
def _get_body_from_req(cls, req):
        """attempts to extract body from req as json, if fails, gets raw body (as string)"""
        assert isinstance(req, requests.PreparedRequest)
        if not req.body:
            return req.body
        try:
            body = json.loads(req.body)
        except TypeError:
            body = req.body.decode('utf-8', errors='replace')
        return body
attempts to extract body from req as json, if fails, gets raw body (as string)
attempts to extract body from req as json, if fails, gets raw body (as string)
attempts to extract body from req as json if fails gets raw body ( as string )
def _get_body_from_req(cls, req):
        assert isinstance(req, requests.PreparedRequest)
        if not req.body:
            return req.body
        try:
            body = json.loads(req.body)
        except TypeError:
            body = req.body.decode('utf-8', errors='replace')
        return body
def _get_body_from_req ( cls , req ) : assert isinstance ( req , requests . PreparedRequest ) if not req . body : return req . body try : body = json . loads ( req . body ) except TypeError : body = req . body . decode ( 'utf-8' , errors = 'replace' ) return body
attempts to extract body from req as json, if fails, gets raw body (as string)
attempts to extract body from req as json if fails gets raw body ( as string )
"""attempts to extract body from req as json, if fails, gets raw body (as string)"""
cls
req