rearragne some stuff

This commit is contained in:
2026-07-26 17:21:54 -07:00
parent 5f7aa21daa
commit b263f0b0c1
2 changed files with 62 additions and 45 deletions
+2 -45
View File
@@ -1,50 +1,7 @@
package main
import (
"fmt"
"io"
"log"
"net/http"
"strings"
)
func main() {
read_config()
client := &http.Client{}
xml := `
<?xml version="1.0" encoding="UTF-8"?>
<d:propfind xmlns:d="DAV:">
<d:prop>
<d:displayname/>
<d:resourcetype/>
</d:prop>
</d:propfind>
`
body := strings.NewReader(xml)
req, _ := http.NewRequest(
"PROPFIND",
serverConfig.URL+"/dav/cal/"+convert_username_into_url(serverConfig.Username),
body,
)
req.SetBasicAuth(serverConfig.Username, serverConfig.Password)
req.Header.Set("Depth", "1")
req.Header.Set("Content-Type", "application/xml")
resp, err := client.Do(req)
if err != nil {
fmt.Print(err.Error())
}
defer resp.Body.Close()
body2, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(body2))
init_dav_client()
get_caldav_data(serverConfig.Username, serverConfig.Password)
}