code: def get_request_data():
      
      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
docs: 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