mirror of
https://github.com/adnanh/webhook.git
synced 2025-05-30 01:02:29 +00:00
Merge pull request #373 from moorereason/feature/multipart
Add multipart form data support
This commit is contained in:
commit
f38dfbbf78
6 changed files with 251 additions and 44 deletions
|
@ -287,12 +287,12 @@ __Not recommended in production due to low security__
|
|||
]
|
||||
```
|
||||
|
||||
# JIRA Webhooks
|
||||
## JIRA Webhooks
|
||||
[Guide by @perfecto25](https://sites.google.com/site/mrxpalmeiras/notes/jira-webhooks)
|
||||
|
||||
# Pass File-to-command sample
|
||||
## Pass File-to-command sample
|
||||
|
||||
## Webhook configuration
|
||||
### Webhook configuration
|
||||
|
||||
<pre>
|
||||
[
|
||||
|
@ -315,7 +315,7 @@ __Not recommended in production due to low security__
|
|||
]
|
||||
</pre>
|
||||
|
||||
## Sample client usage
|
||||
### Sample client usage
|
||||
|
||||
Store the following file as `testRequest.json`.
|
||||
|
||||
|
@ -474,3 +474,47 @@ Given the following payload:
|
|||
}
|
||||
]
|
||||
```
|
||||
|
||||
## Multipart Form Data
|
||||
|
||||
Example of a [Plex Media Server webhook](https://support.plex.tv/articles/115002267687-webhooks/).
|
||||
The Plex Media Server will send two parts: payload and thumb.
|
||||
We only care about the payload part.
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "plex",
|
||||
"execute-command": "play-command.sh",
|
||||
"parse-parameters-as-json": [
|
||||
{
|
||||
"source": "payload",
|
||||
"name": "payload"
|
||||
}
|
||||
],
|
||||
"trigger-rule":
|
||||
{
|
||||
"match":
|
||||
{
|
||||
"type": "value",
|
||||
"parameter": {
|
||||
"source": "payload",
|
||||
"name": "payload.event"
|
||||
},
|
||||
"value": "media.play"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
```
|
||||
|
||||
Each part of a multipart form data body will have a `Content-Disposition` header.
|
||||
Some example headers:
|
||||
|
||||
```
|
||||
Content-Disposition: form-data; name="payload"
|
||||
Content-Disposition: form-data; name="thumb"; filename="thumb.jpg"
|
||||
```
|
||||
|
||||
We key off of the `name` attribute in the `Content-Disposition` value.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue