@heroku-cli/plugin-api

2.2.0 • Public • Published

API Plugin for Heroku Toolbelt Circle CI

npm version CircleCI Build status

How to install this plugin

$ heroku plugins:install api

Usage

heroku api METHOD [PATH]

make a manual API request

USAGE
  $ heroku api METHOD [PATH]

ARGUMENTS
  METHOD  GET, POST, PUT, PATCH, or DELETE
  PATH    endpoint to call

OPTIONS
  -a, --accept-inclusion=accept-inclusion  Accept-Inclusion header to use
  -b, --body=body                          JSON input body
  -v, --version=version                    version to use (e.g. 2, 3, or 3.variant)

DESCRIPTION
  The api command is a convenient but low-level way to send requests
  to the Heroku API. It sends an HTTP request to the Heroku API
  using the given method on the given path. For methods PUT, PATCH,
  and POST, it uses stdin unmodified as the request body. It prints
  the response unmodified on stdout.

  It is essentially like curl for the Heroku API.

  Method name input will be upcased, so both 'heroku api GET /apps' and
  'heroku api get /apps' are valid commands.

EXAMPLE
  $ heroku api GET /apps/myapp
  {
     created_at: "2011-11-11T04:17:13-00:00",
     id: "12345678-9abc-def0-1234-456789012345",
     name: "myapp",
     …
  }

  $ heroku api PATCH /apps/myapp/config-vars --body '{"FOO": "bar"}'
  {
     FOO: "bar"
     …
  }

  $ export HEROKU_HEADERS
  $ HEROKU_HEADERS='{
  "Content-Type": "application/x-www-form-urlencoded",
  "Accept": "application/json"
  }'
  $ printf 'type=web&qty=2' | heroku api POST /apps/myapp/ps/scale
  2

See code: src/commands/api.ts

Readme

Keywords

Package Sidebar

Install

npm i @heroku-cli/plugin-api

Weekly Downloads

91

Version

2.2.0

License

ISC

Unpacked Size

11.5 kB

Total Files

7

Last publish

Collaborators

  • hillzbot2000
  • kdreyeroren
  • beanieboi
  • beckychen
  • xx-sfdc-npm
  • kpremkumar
  • abhinavkoul
  • daniel.bright
  • justinwilaby-sf
  • cv88
  • jlopezdan
  • jmonreal
  • jondaniel-sfdc
  • dhagberg-sf
  • jmorrell-sfdc
  • elzoona
  • cmarcojos
  • gkommineni
  • vlazuka
  • nlanatta
  • lucaszhou
  • mars
  • mimen
  • wchrisjohnson
  • cbaxtersf
  • heroku-front-end
  • bsperlingsf
  • zli-sf
  • 7ftz
  • joanneyeung
  • montes_heroku
  • jwadsworthsf
  • jheikes
  • lmckenzie
  • sarassassin
  • pfuente
  • reidmix
  • mbuschheroku
  • k.plenty
  • eblack
  • sheax0r
  • k80bowman
  • rdagg-hero
  • grundy.g
  • robinson.m
  • tcareysmith-sfdc
  • ptemporini
  • paulaprado18
  • harish.457
  • ntonollier