<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_request_data():
 """ Get request data based on request.method If method is GET or DELETE, get data from request.args If method is POST, PATCH or PUT, get data from request.form or request.json """

    method = request.method.lower()
    if method in ["get", "delete"]:
        return request.args
    elif method in ["post", "put", "patch"]:
        if request.mimetype == 'application/json':
            try:
                return request.get_json()
            except:
                abort(400, "InvalidData", "invalid json content")
        else:
            return request.form
    else:
        return None