Skip to content

Commit fe90245

Browse files
committed
chore: [api] add more examples
1 parent 4681e60 commit fe90245

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg/cmd/api/api.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ func NewCmdApi(f *cmdutil.Factory, runF func(*ApiOptions) error) *cobra.Command
9393
9494
# list models
9595
$ instill api models
96+
97+
# add parameters to a GET request
98+
$ instill api models?visibility=public
99+
100+
# add parameters to a POST request
101+
$ instill api -X POST oauth2/token?audience=...&grant_type=...
102+
103+
# add nested JSON body to a POST request
104+
$ jq -n '{"contents":[{"url": "https://artifacts.instill.tech/dog.jpg"}]}' | instill api demo/tasks/classification/outputs --input -
105+
106+
# set a custom HTTP header
107+
$ instill api -H 'Authorization: Basic ...'
96108
`),
97109
Annotations: map[string]string{
98110
"help:environment": heredoc.Doc(`

0 commit comments

Comments
 (0)