http.post
Sends a HTTP POST request to any URL using Axios.
Parameters
| Parameter | Description |
|---|---|
| url: string | Target URL |
| data: any | Data to be sent to the target URL |
| config?: object | Axios HTTP configuration for sending HTTP headers, setting up a proxy, etc. (Optional) |
Returns
Promise resolved with an object containing status, statusText, headers, and data from the Axios response. The response body is in data.
Examples
Post some data to create a new entity using a REST API endpoint
module.exports = async function(payload, actions, context) {
const { data } = await actions.http.post(
'http://my.api.com/things',
{ a: 1 }
);
console.log('created a thing: { a: 1 }', data);
}