def _post_request(self, url_path: str, body: Any) -> Any:
        """Perform a ``POST`` request to *url_path* serializing *body* as JSON.

        :param url_path: URL to perform the ``POST`` request against.
        :param body: the body to be serialized as JSON and sent in the request.

        :returns: the deserialized response body.

        :raises:
            :exc:`RetriesExceeded`: raised from the corresponding :mod:`urllib3`
                exception.
        """
        body = self._serialize_request(body)

        url = self._build_full_url(url_path)
        response = None

        try:
            response = self._http.request("POST",
                                          url,
                                          body=body,
                                          headers={
                                              "Content-Type": "application/json"
                                          })
        except MaxRetryError as exc:
            msg = f"Failed to perform a POST request to {url} with {body}"
            raise RetriesExceeded(msg) from exc

        return self._deserialize_response(response)
Perform a ``POST`` request to *url_path* serializing *body* as JSON.

        :param url_path: URL to perform the ``POST`` request against.
        :param body: the body to be serialized as JSON and sent in the request.

        :returns: the deserialized response body.

        :raises:
            :exc:`RetriesExceeded`: raised from the corresponding :mod:`urllib3`
                exception.
        
patroni/scripts/barman/utils.py