rsconnect-python
rsconnect-python copied to clipboard
Use `v1/bootstrap` if Connect version supports it
As this endpoint comes out of experimental, we should switch to the new endpoint depending on the version of the Connect server we're talking to.
The 2024.05.0 release includes POST /__api__/v1/bootstrap. The POST /__api__/v1/experimental/boostrap endpoint is deprecated and scheduled for removal with 2024.12.0.
rsconnect-python should start using the /v1/ API for Connect 2024.05.0 and newer, using the /v1/experimental/ API for older versions until they pass beyond the support horizon (18mos from 2024.04.0).
A challenge for this particular endpoint: the internal server_settings API is used to obtain the Connect version, but server version is not provided to unauthenticated requests.
Hmm, then do we have to
try:
POST /__api__/v1/bootstrap
except:
POST /__api__/v1/experimental/bootstrap