Problems with axios posting


I am trying to post results from a query in nodejs to an enpoint. When i do a post with postman with the expected parameters, i get a successful response, but when i use axios i keep getting an error

data: '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">\n' +
     '<html><head>\n' +
     '<title>400 Bad Request</title>\n' +
     '</head><body>\n' +
     '<h1>Bad Request</h1>\n' +
     '<p>Your browser sent a request that this server could not understand.<br />\n' +
     '</p>\n' +
     '<hr>\n' +
     '<address>Apache/2.4.29 (Ubuntu) Server at localhost Port 80</address>\n' +

My code looks like this

//check unsent appointments
                    connection.query("select * from appointments where processed=0 ", function (err, results, fields) {
                        if(err) {console.log(err)};
                        var test = results.forEach(result => {


                  '', result)
                            .then(function (response){

                                //update status of updated appointment
                                result = connection.query("update appointments set processed ='1', date_processed ='"+DATE_TODAY+"', send_log='" +"' where id="" ")
                            .catch(function (error){

                                console.log(error )

                                //update appointment with error
                                result = connection.query("update appointments set date_processed ='"+DATE_TODAY+"', send_log='" +error +"' where id="" ")



Any assistance/recommendations will be appreciated. Thanks.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.