code: def write(self, data):
      self.artifact.consumed()
      try:
          output = requests.post(
              url=self.artifact.uri.original_uri, json=dict(data=[data])
          )
      except Exception as e:
          logger.error(
              f"write data `{data}` to {self.artifact.uri.original_uri} failed, error: {e}"
          )
      else:
          logger.debug(
              f"write data to {self.artifact.uri.original_uri} success, output: {output}"
          )
  
imports: import json
  import logging
  import typing
  from pathlib import Path
  from typing import Dict, Optional, Union
  import requests
  from fate.components.core.essential import JsonMetricArtifactType
  from .._base_type import URI, ArtifactDescribe, Metadata, MetricOutputMetadata, _ArtifactType, _ArtifactTypeWriter
label_desc: Use image node_id 1 for calling the JsonMetricRestfulWriter obj's underlying member method code with example usage: obj.write(data) without return types