* * Similar to axious post(url, data, [config]) * * @see https://github.com/axios/axios#axiosposturl-data-config-1 * @see https://masteringjs.io/tutorials/axios/put * * @param {*} url resource URL for the PUT request * @param {*} data data payload for the PUT req
(url: string, json: string, data: any, config: any = {})
| 477 | * @param {*} config request header options |
| 478 | */ |
| 479 | async post (url: string, json: string, data: any, config: any = {}) { |
| 480 | console.debug('POST', { url, data, config }) |
| 481 | config.url = url |
| 482 | config.method = 'POST' |
| 483 | config.json = json |
| 484 | config.data = data |
| 485 | const response = this.request(config) |
| 486 | console.debug('post() received response', { response }) |
| 487 | return response |
| 488 | } |
| 489 | |
| 490 | /** |
| 491 | * |