Skip to content

Instantly share code, notes, and snippets.

@jmarmolejos
Last active June 7, 2018 13:34
Show Gist options
  • Save jmarmolejos/ad61bb943310ea68b29754a7022b2c2d to your computer and use it in GitHub Desktop.
Save jmarmolejos/ad61bb943310ea68b29754a7022b2c2d to your computer and use it in GitHub Desktop.
config kong
-- Add api
$ curl -i -X POST \
--url http://localhost:8001/apis/ \
--data 'name=requestbin' \
--data 'upstream_url=http://requestb.in/' \
--data 'request_host=requestb.in'
-- Update api
$ curl -i -X PATCH \
--url http://localhost:8001/apis/requestbin \
--data 'strip_request_path=true'
-- Proxy a request
$ curl -i -X GET \
--url http://localhost:8000/ \
--header 'Host: requestb.in' \
--header "apikey: Rm9vYmFy"
-- Configure key-auth plugin
$ curl -i -X POST \
--url http://localhost:8001/apis/requestbin/plugins/ \
--data 'name=key-auth'
-- Create a consumer
$ curl -i -X POST \
--url http://localhost:8001/consumers/ \
--data "username=requestbin_user"
-- Provision credentials
$ curl -i -X POST \
--url http://localhost:8001/consumers/requestbin_user/key-auth/ \
--data 'key=Rm9vYmFy'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment