{"record":{"id":"a6adce74396c1500","repo":"AlistGo/alist","slug":"unsupported-method-method","errorCode":null,"errorMessage":"Unsupported method: {method}","messagePattern":"Unsupported method: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/gowebdav/cmd/gowebdav/main.go","lineNumber":121,"sourceCode":"\n\tcase \"MKCOL\", \"MKDIR\":\n\t\treturn cmdMkdir\n\n\tcase \"MKCOLALL\", \"MKDIRALL\", \"MKDIRP\":\n\t\treturn cmdMkdirAll\n\n\tcase \"RENAME\", \"MV\", \"MOVE\":\n\t\treturn cmdMv\n\n\tcase \"COPY\", \"CP\":\n\t\treturn cmdCp\n\n\tcase \"PUT\", \"PUSH\", \"WRITE\":\n\t\treturn cmdPut\n\n\tdefault:\n\t\treturn func(c *d.Client, p0, p1 string) (err error) {\n\t\t\treturn errors.New(\"Unsupported method: \" + method)\n\t\t}\n\t}\n}\n\nfunc cmdLs(c *d.Client, p0, _ string) (err error) {\n\tfiles, err := c.ReadDir(p0)\n\tif err == nil {\n\t\tfmt.Println(fmt.Sprintf(\"ReadDir: '%s' entries: %d \", p0, len(files)))\n\t\tfor _, f := range files {\n\t\t\tfmt.Println(f)\n\t\t}\n\t}\n\treturn\n}\n\nfunc cmdStat(c *d.Client, p0, _ string) (err error) {\n\tfile, err := c.Stat(p0)\n\tif err == nil {","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/pkg/gowebdav/cmd/gowebdav/main.go#L103-L139","documentation":"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.","triggerScenarios":"Running `gowebdav <anything-not-in-switch> <url>` — e.g. `gowebdav GET http://...`, `gowebdav info ...`, or a typo like `gowebdav ST`.","commonSituations":"Using an unsupported verb (GET/HEAD/PATCH are not aliases here), misspelling a supported one, or assuming every WebDAV verb has a CLI alias.","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"],"exampleFix":"// before\n$ gowebdav GET https://dav.example.com/remote.php/dav/files/user/\n\n// after\n$ gowebdav LS https://user:pass@dav.example.com/remote.php/dav/files/user/","handlingStrategy":"validation","validationCode":"var validMethods = map[string]bool{\n\t\"LS\": true, \"STAT\": true, \"MKDIR\": true, \"RMDIR\": true,\n\t\"RM\": true, \"DEL\": true, \"RENAME\": true, \"MV\": true, \"MOVE\": true,\n\t\"COPY\": true, \"CP\": true, \"PUT\": true, \"PUSH\": true, \"WRITE\": true,\n}\nif !validMethods[strings.ToUpper(os.Args[1])] {\n\tfmt.Fprintln(os.Stderr, \"unsupported method; valid:\", validMethods)\n\tos.Exit(2)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Print the supported verb list in the CLI usage/help text","Uppercase-normalize the method argument before dispatch"],"tags":["gowebdav","cli","webdav","usage"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}