2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-09-23 02:28:39 +00:00

Fix invoke to a file to not repeat the request

This commit is contained in:
Jarrod Johnson
2025-03-21 09:12:57 -04:00
parent 24e419568a
commit 84881cc6be

View File

@@ -97,11 +97,13 @@ func main() {
mime = "application/json"
}
if *outputfile != "" {
apiclient.Fetch(invokeapi.Arg(0), *outputfile, mime, body)
err := apiclient.Fetch(invokeapi.Arg(0), *outputfile, mime, body)
if err != nil { panic(err) }
} else {
rsp, err := apiclient.GrabText(invokeapi.Arg(0), mime, body)
if err != nil { panic(err) }
fmt.Println(rsp)
}
rsp, err := apiclient.GrabText(invokeapi.Arg(0), mime, body)
if err != nil { panic(err) }
fmt.Println(rsp)
default:
panic("Unrecognized subcommand")
}