Hi. I use Autopilot. Inside, I have a task with action "redirect", which redirects to my express server. I know I could use Twilio functions, but I also need to access DB. I would like to process the request sent from Twilio in express. But I am unable to extract the data from request. Both req.params and req.query are empty.
EDIT: I changed method on both sides to GET and now it works.
EDIT2: The problem has emerged again. I need to use POST method to be able to access Memory. But params, query and body are all empty.
I'm a developer, product manager and public speaker based in the SF Bay Area. I'm passionate for JavaScript, the web, hackathons, teaching, photography & cocktails.
I'm glad you were able to unblock yourself. Yes you have to use the app.use(bodyParser.urlencoded({ extended: false})) option because Twilio performs HTTP POST requests with the data type of application/x-www-form-urlencoded and Express has removed automatic body parsing from their implementation some time ago.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi. I use Autopilot. Inside, I have a task with action "redirect", which redirects to my express server. I know I could use Twilio functions, but I also need to access DB. I would like to process the request sent from Twilio in express. But I am unable to extract the data from request. Both req.params and req.query are empty.
EDIT: I changed method on both sides to GET and now it works.
EDIT2: The problem has emerged again. I need to use POST method to be able to access Memory. But params, query and body are all empty.
EDIT3: The solution was to use
I'm glad you were able to unblock yourself. Yes you have to use the
app.use(bodyParser.urlencoded({ extended: false}))
option because Twilio performs HTTP POST requests with the data type ofapplication/x-www-form-urlencoded
and Express has removed automatic body parsing from their implementation some time ago.