parameters: (self, endpoint, data=None, headers=None, timeout_secs=_TIMEOUT_SECS)
return_statement: return response.text
docstring: Sends a POST request to the specified endpoint with the supplied
          data.
  
          Returns the response, either as a string or a JSON object based
          on the content type.
docstring_summary: Sends a POST request to the specified endpoint with the supplied
          data.
docstring_tokens: Sends a POST request to the specified endpoint with the supplied data .
function: def post(self, endpoint, data=None, headers=None, timeout_secs=_TIMEOUT_SECS):
          """
          Sends a POST request to the specified endpoint with the supplied
          data.
  
          Returns the response, either as a string or a JSON object based
          on the content type.
          """
  
          data = utils.default_if_none(data, [])
          data = json.dumps(data, encoding="utf-8")
  
          headers = utils.default_if_none(headers, {})
          headers["Content-Type"] = "application/json; charset=utf-8"
  
          url = self._make_url(endpoint)
  
          # Versions of Python earlier than 2.7.9 do not support certificate validation. So we
          # disable certificate validation for older Python versions.
          should_validate_certificates = sys.version_info >= (2, 7, 9)
          with warnings.catch_warnings():
              if urllib3_exceptions is not None and not should_validate_certificates:
                  try:
                      warnings.simplefilter("ignore", urllib3_exceptions.InsecurePlatformWarning)
                  except AttributeError:
                      # Versions of urllib3 prior to 1.10.3 didn't define InsecurePlatformWarning.
                      # Versions of requests prior to 2.6.0 didn't have a vendored copy of urllib3
                      # that defined InsecurePlatformWarning.
                      pass
  
                  try:
                      warnings.simplefilter("ignore", urllib3_exceptions.InsecureRequestWarning)
                  except AttributeError:
                      # Versions of urllib3 prior to 1.9 didn't define InsecureRequestWarning.
                      # Versions of requests prior to 2.4.0 didn't have a vendored copy of urllib3
                      # that defined InsecureRequestWarning.
                      pass
  
              response = requests.post(url,
                                       data=data,
                                       headers=headers,
                                       timeout=timeout_secs,
                                       auth=self.auth_handler,
                                       verify=should_validate_certificates)
  
          response.raise_for_status()
  
          if not response.encoding:
              response.encoding = "utf-8"
  
          headers = response.headers
  
          if headers["Content-Type"].startswith("application/json"):
              return response.json()
  
          return response.text
function_tokens: def post ( self , endpoint , data = None , headers = None , timeout_secs = _TIMEOUT_SECS ) : data = utils . default_if_none ( data , [ ] ) data = json . dumps ( data , encoding = "utf-8" ) headers = utils . default_if_none ( headers , { } ) headers [ "Content-Type" ] = "application/json; charset=utf-8" url = self . _make_url ( endpoint ) # Versions of Python earlier than 2.7.9 do not support certificate validation. So we # disable certificate validation for older Python versions. should_validate_certificates = sys . version_info >= ( 2 , 7 , 9 ) with warnings . catch_warnings ( ) : if urllib3_exceptions is not None and not should_validate_certificates : try : warnings . simplefilter ( "ignore" , urllib3_exceptions . InsecurePlatformWarning ) except AttributeError : # Versions of urllib3 prior to 1.10.3 didn't define InsecurePlatformWarning. # Versions of requests prior to 2.6.0 didn't have a vendored copy of urllib3 # that defined InsecurePlatformWarning. pass try : warnings . simplefilter ( "ignore" , urllib3_exceptions . InsecureRequestWarning ) except AttributeError : # Versions of urllib3 prior to 1.9 didn't define InsecureRequestWarning. # Versions of requests prior to 2.4.0 didn't have a vendored copy of urllib3 # that defined InsecureRequestWarning. pass response = requests . post ( url , data = data , headers = headers , timeout = timeout_secs , auth = self . auth_handler , verify = should_validate_certificates ) response . raise_for_status ( ) if not response . encoding : response . encoding = "utf-8" headers = response . headers if headers [ "Content-Type" ] . startswith ( "application/json" ) : return response . json ( ) return response . text