AlistGo/alist · error
Unsupported method: {method}
Error message
Unsupported method: {method} What it means
Thrown by the gowebdav demo CLI's command dispatcher when the first CLI argument (the "method") does not match any known verb. The switch maps aliases like LS, STAT, MKDIR, RM, MV, CP, PUT, etc. to handlers; any other string falls through to a stub that returns this error instead of executing anything.
Source
Thrown at pkg/gowebdav/cmd/gowebdav/main.go:121
case "MKCOL", "MKDIR":
return cmdMkdir
case "MKCOLALL", "MKDIRALL", "MKDIRP":
return cmdMkdirAll
case "RENAME", "MV", "MOVE":
return cmdMv
case "COPY", "CP":
return cmdCp
case "PUT", "PUSH", "WRITE":
return cmdPut
default:
return func(c *d.Client, p0, p1 string) (err error) {
return errors.New("Unsupported method: " + method)
}
}
}
func cmdLs(c *d.Client, p0, _ string) (err error) {
files, err := c.ReadDir(p0)
if err == nil {
fmt.Println(fmt.Sprintf("ReadDir: '%s' entries: %d ", p0, len(files)))
for _, f := range files {
fmt.Println(f)
}
}
return
}
func cmdStat(c *d.Client, p0, _ string) (err error) {
file, err := c.Stat(p0)
if err == nil {View on GitHub (pinned to 843d9dc814)
Solutions
- Use one of the supported verbs/aliases handled by the switch: LS, STAT, MKDIR, RMDIR, RM, DEL, RENAME, MV, MOVE, COPY, CP, PUT, PUSH, WRITE (check the full switch in main.go for the exact list)
- Check spelling and case of the method argument
- If you need an unlisted verb, note this is only the sample CLI in pkg/gowebdav/cmd; use the gowebdav.Client API directly in your own program
Example fix
// before $ gowebdav GET https://dav.example.com/remote.php/dav/files/user/ // after $ gowebdav LS https://user:pass@dav.example.com/remote.php/dav/files/user/
Defensive patterns
Strategy: validation
Validate before calling
var validMethods = map[string]bool{
"LS": true, "STAT": true, "MKDIR": true, "RMDIR": true,
"RM": true, "DEL": true, "RENAME": true, "MV": true, "MOVE": true,
"COPY": true, "CP": true, "PUT": true, "PUSH": true, "WRITE": true,
}
if !validMethods[strings.ToUpper(os.Args[1])] {
fmt.Fprintln(os.Stderr, "unsupported method; valid:", validMethods)
os.Exit(2)
} Prevention
- Print the supported verb list in the CLI usage/help text
- Uppercase-normalize the method argument before dispatch
When it happens
Trigger: Running `gowebdav <anything-not-in-switch> <url>` — e.g. `gowebdav GET http://...`, `gowebdav info ...`, or a typo like `gowebdav ST`.
Common situations: Using an unsupported verb (GET/HEAD/PATCH are not aliases here), misspelling a supported one, or assuming every WebDAV verb has a CLI alias.
Related errors
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/a6adce74396c1500.
Report an issue: GitHub.