code: def create_body(action, params):
          
          body = {}
          body['action'] = action
          if params is not None:
              body['params'] = params
          return body
docs: Create http body for rest request.