code: def test_restful_api(deployment, query, restful_api_port):
      generator = mii.mii_query_handle(deployment)
      for _ in range(2):
          result = generator.query(query)
  
      url = f"http://localhost:{restful_api_port}/mii/{deployment}"
      params = {"request": query}
      json_params = json.dumps(params)
      result = requests.post(
          url,
          data=json_params,
          headers={"Content-Type": "application/json"},
      )
      assert result.status_code == 200
      assert "response" in result.json()
  
file_path: deepspeed-mii/tests/legacy/test_deployment_options.py
imports: import pytest
  import json
  import requests
  import mii.legacy
  from mii.legacy import pydantic_v1
label_desc: Use image node_id 2 for calling a global function with example usage: test_restful_api(deployment, query, restful_api_port) without return types