From b567aaff798bb704d1b019327e3b239200940439 Mon Sep 17 00:00:00 2001 From: baoskee Date: Thu, 26 Mar 2020 19:49:32 -0700 Subject: [PATCH 1/3] docs(admin-api) Content types support multipart. Added multipart as supported content type, and moved JSON format to beginning of section. --- app/2.0.x/admin-api.md | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/app/2.0.x/admin-api.md b/app/2.0.x/admin-api.md index d7984aef6054..000795a88d99 100644 --- a/app/2.0.x/admin-api.md +++ b/app/2.0.x/admin-api.md @@ -559,17 +559,7 @@ of methods to secure the Admin API. ## Supported Content Types -The Admin API accepts 2 content types on every endpoint: - -- **application/x-www-form-urlencoded** - -Simple enough for basic request bodies, you will probably use it most of the time. -Note that when sending nested values, Kong expects nested objects to be referenced -with dotted keys. Example: - -``` -config.limit=10&config.period=seconds -``` +The Admin API accepts 3 content types on every endpoint: - **application/json** @@ -585,6 +575,29 @@ a JSON representation of the data you want to send. Example: } ``` + +- **application/x-www-form-urlencoded** + +Simple enough for basic request bodies, you will probably use it most of the time. +Note that when sending nested values, Kong expects nested objects to be referenced +with dotted keys. Example: + +``` +config.limit=10&config.period=seconds +``` + + +- **multipart/form-data** + +Similar to url-encoded, you will use dotted keys to reference nested objects. +Here is an example of sending a Lua file to the pre-function Kong plugin. + +``` +curl -i -X POST http://localhost:8001/services/plugin-testing/plugins \ + -F "name=pre-function" \ + -F "config.functions=@custom-auth.lua" +``` + --- ## Information Routes From 1aa38888f52ce9787c950c7082d8f57727948b6e Mon Sep 17 00:00:00 2001 From: baokong <51422077+baokong@users.noreply.github.com> Date: Thu, 2 Apr 2020 10:17:29 -0700 Subject: [PATCH 2/3] Update app/2.0.x/admin-api.md Co-Authored-By: lena-larionova <54370747+lena-larionova@users.noreply.github.com> --- app/2.0.x/admin-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/2.0.x/admin-api.md b/app/2.0.x/admin-api.md index 000795a88d99..2fcc5d0deff5 100644 --- a/app/2.0.x/admin-api.md +++ b/app/2.0.x/admin-api.md @@ -590,7 +590,7 @@ config.limit=10&config.period=seconds - **multipart/form-data** Similar to url-encoded, you will use dotted keys to reference nested objects. -Here is an example of sending a Lua file to the pre-function Kong plugin. +Here is an example of sending a Lua file to the pre-function Kong plugin: ``` curl -i -X POST http://localhost:8001/services/plugin-testing/plugins \ From 739fed8505ce162be1d384372c95b9206d8d2e50 Mon Sep 17 00:00:00 2001 From: baokong <51422077+baokong@users.noreply.github.com> Date: Thu, 2 Apr 2020 10:17:48 -0700 Subject: [PATCH 3/3] Update app/2.0.x/admin-api.md Co-Authored-By: lena-larionova <54370747+lena-larionova@users.noreply.github.com> --- app/2.0.x/admin-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/2.0.x/admin-api.md b/app/2.0.x/admin-api.md index 2fcc5d0deff5..b98486e9698c 100644 --- a/app/2.0.x/admin-api.md +++ b/app/2.0.x/admin-api.md @@ -589,7 +589,7 @@ config.limit=10&config.period=seconds - **multipart/form-data** -Similar to url-encoded, you will use dotted keys to reference nested objects. +Similar to url-encoded, this content type uses dotted keys to reference nested objects. Here is an example of sending a Lua file to the pre-function Kong plugin: ```