#
write-http
For each event, make an HTTP request. The request body will be defined as:
- Empty when
request().methodis not one of: POST, PUT, PATCH, or event.payloadwhen defined, or- JSON(event) otherwise
#
Config
Required:
request: Function that returns request options:method: HTTP method (GET, POST, DELETE, PUT, PATCH)url: Target HTTP endpointheaders: HTTP headers
Optional:
#
Example
pipeline:
write-http:
config:
request: !!js/function >-
function (event) {}
return {
method: 'PUT',
url: `http://localhost:1337/user/${event.id}?tag=foo&tag=bar`,
headers: {
'user-agent': 'my-agent/1.0',
},
}
}