Perhaps just use webdav (some randomly found links related to this topic):
https://github.com/perry-mitchell/webdav-client