Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(admin-api) Content types support multipart. #1889

Merged
merged 3 commits into from
Apr 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions app/2.0.x/admin-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand All @@ -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, 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:

```
curl -i -X POST http://localhost:8001/services/plugin-testing/plugins \
-F "name=pre-function" \
-F "config.functions=@custom-auth.lua"
```

---

## Information Routes
Expand Down