try {
console.log('header :', headers, ', url :', url, ', payload :', payload)
const response = await axios.post(url, payload, { headers })
console.log('message_status', response.data)
} catch (error) {
if (error.response) {
console.error('Server responded with a status:', error.response.status)
console.error('Response data:', error.response.data)
} }
it prints the console.log correctly
header: { Authorization: 'Bearer 86dc95222137',
'Content-Type': 'application/json' }, url:
https://apiproxy.one/86dc95222137, payload: { purpose: 'sendmessage',
message_data:
{ messaging_product: 'whatsapp',
recipient_type: 'individual',
to: 'xxxxxxxxxxx',
type: 'text',
text: { body: 'Test' } } }
but nothing from axios.post. Neither the POST works, nor it gives error