Options (5)
-H, --headerbooleanCreate a reaction for a specific issue
Example:
gh api {{[-H|--header]}} {{Accept:application/vnd.github.squirrel-girl-preview+json}} {{[-f|--raw-field]}} '{{content=+1}}' {{repos/:owner/:repo/issues/123/reactions}}-f, --raw-fieldbooleanCreate a reaction for a specific issue
Example:
gh api {{[-H|--header]}} {{Accept:application/vnd.github.squirrel-girl-preview+json}} {{[-f|--raw-field]}} '{{content=+1}}' {{repos/:owner/:repo/issues/123/reactions}}-F, --fieldbooleanDisplay the result of a GraphQL query in JSON format
Example:
gh api graphql {{[-F|--field]}} {{name=':repo'}} {{[-f|--raw-field]}} '{{query}}'-X, --methodbooleanSend a request using a custom HTTP method
Example:
gh api {{[-X|--method]}} {{POST}} {{endpoint}}-i, --includebooleanInclude the HTTP response headers in the output
Example:
gh api {{[-i|--include]}} {{endpoint}}Examples (8)
Display the releases for the current repository in JSON format
gh api repos/:owner/:repo/releasesCreate a reaction for a specific issue
gh api [-H|--header] Accept:application/vnd.github.squirrel-girl-preview+json [-f|--raw-field] 'content=+1' repos/:owner/:repo/issues/123/reactionsDisplay the result of a GraphQL query in JSON format
gh api graphql [-F|--field] name=':repo' [-f|--raw-field] 'query'Send a request using a custom HTTP method
gh api [-X|--method] POST endpointInclude the HTTP response headers in the output
gh api [-i|--include] endpointDo not print the response body
gh api --silent endpointSend a request to a specific GitHub Enterprise Server
gh api --hostname github.example.com endpointDisplay the subcommand help
gh api --helpmade by @shridhargupta | data from tldr-pages