-
Notifications
You must be signed in to change notification settings - Fork 14
Resto CLI Commands
Abdfn edited this page Dec 25, 2021
·
7 revisions
example
resto get https://api.secman.dev
USAGE
resto get <url> [flags]
FLAGS
-H, --headers Just show the response headers
-j, --just-body Just show the response body
-p, --password string The password to use for basic authentication
-s, --save string Save the response body to a file
-t, --token string The bearer token to use for authentication
-u, --username string The username to use for basic authentication
example
resto get-latest denoland/deno
# use another registry
resto get-latest 23028539 --registry gitlab.com
# with access token
resto get-latest spittet/node-postgresql --registry bitbucket.org --token YOUR-ACCESS-TOKEN
USAGE
resto get-latest <repo || id> [flags]
FLAGS
-r, --registry string The registry to use
-t, --token string The access token to use it the registry requires authentication
example
resto head https://vercel.com
USAGE
resto head <url> [flags]
FLAGS
-H, --headers Just show the response headers
-j, --just-body Just show the response body
-p, --password string The password to use for basic authentication
-s, --save string Save the response body to a file
-t, --token string The bearer token to use for authentication
-u, --username string The username to use for basic authentication
this command is alternative to
curl -sL URL | bash
sh -c "$(wget -O- URL)"
sh -c "$(fetch -o - URL"
demo
example
resto install https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
resto i https://yarnpkg.org/install.sh
USAGE
resto install <url> [flags]
FLAGS
-s, --shell string shell to use
example
resto patch $URL
USAGE
resto patch <url> [flags]
FLAGS
-b, --body string The body of the request
-i, --body-stdin Read the body from stdin
-c, --content-type string The content type of the body
-e, --editor Open the editor to edit the body
-H, --headers Just show the response headers
-j, --just-body Just show the response body
-p, --password string The password to use for basic authentication
-s, --save string Save the response to a file
-t, --token string The bearer token to use for authentication
-u, --username string The username to use for basic authentication
example
resto post https URL --content-type CONTENT-TYPE -b BODY
# Send a request to a URL and use resto editor
resto post https://localhost:8080/api --content-type json --editor
# Read Body from stdin
cat schema.graphql | resto post https://api.spacex.land/graphql --content-type graphql --body-stdin
# Use Authentecation with Basic Auth or Bearer Token
resto post https://api.secman.dev/api/logins/13 --content-type json --token TOKEN
# Save response to a file
resto post http://localhost:3333/api/v1/hello -b "BODY" --save response.json
example
resto patch URL --content-type json
USAGE
resto patch <url> [flags]
FLAGS
-b, --body string The body of the request
-i, --body-stdin Read the body from stdin
-c, --content-type string The content type of the body
-e, --editor Open the editor to edit the body
-H, --headers Just show the response headers
-j, --just-body Just show the response body
-p, --password string The password to use for basic authentication
-s, --save string Save the response to a file
-t, --token string The bearer token to use for authentication
-u, --username string The username to use for basic authentication
example
resto delete https://api.apix.codes --content-type json --token TOKEN
USAGE
resto delete <url> [flags]
FLAGS
-b, --body string The body of the request
-i, --body-stdin Read the body from stdin
-c, --content-type string The content type of the body
-e, --editor Open the editor to edit the body
-H, --headers Just show the response headers
-j, --just-body Just show the response body
-p, --password string The password to use for basic authentication
-s, --save string Save the response to a file
-t, --token string The bearer token to use for authentication
-u, --username string The username to use for basic authentication
demo
example
resto run
resto run --file PATH-TO-FILE
USAGE
resto run [flags]
FLAGS
-a, --all Show all response headers & status
-f, --file string Path to Restofile (Default: PATH/Restofile)