Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6341775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:06:17+00:00 2026-05-24T20:06:17+00:00

I have an express app and a POST route: app.post(‘/test’, function(req, res){ //res.send(req.body.title +

  • 0

I have an express app and a POST route:

app.post('/test', function(req, res){

 //res.send(req.body.title + req.body.body)
 console.log(req.params);
 console.log(req.body);
 console.log(req.body.user);
 console.log(req.body.feedback);
 console.log("ok");
 //return;
});

I try to do ~ $ curl -X POST "http://xxxx.herokuapp.com/test?user=hello" and I get:

TypeError: Cannot read property 'user' of undefined
    at Router.<anonymous> (/app/app.js:40:22)
    at done (/app/node_modules/express/lib/router/index.js:250:22)
    at middleware (/app/node_modules/express/lib/router/index.js:244:9)
    at param (/app/node_modules/express/lib/router/index.js:227:11)
    at pass (/app/node_modules/express/lib/router/index.js:232:6)
    at Router._dispatch (/app/node_modules/express/lib/router/index.js:255:4)
    at Object.handle (/app/node_modules/express/lib/router/index.js:45:10)
    at next (/app/node_modules/express/node_modules/connect/lib/http.js:198:15)
    at Object.methodOverride [as handle] (/app/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js:35:5)
    at next (/app/node_modules/express/node_modules/connect/lib/http.js:198:15)~ $ 

Shouldn’t that POST work?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:06:18+00:00Added an answer on May 24, 2026 at 8:06 pm

    No, the parameter you are passing is not on the post body but in the querystring.

    According to the docs, to access it you must do:

    req.query.user
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say i have this code to separate routes in expressjs: module.exports = function(express,app,client) {
I have a simple app that uses an SQL Express 2005 database. When the
hi i have written app on vs2008 c# (express edition) on win XP which
I am developing a Silverlight app using VS2008 Express. I have just implemented a
I have a Node.js Express app that I'm hosting on Nodejitsu. I'm already using
I have a folder in my express.js app containing three files: // models/one.js exports.One
Let's say I have the following app.js (obviously very simplified): var express = require('express'),
I have this as configuration of my Express server app.use(app.router); app.use(express.cookieParser()); app.use(express.session({ secret: keyboard
I have an express app that I want to use the connect-form module on
I have an app which uses SQL Express and my customers are mainly people

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.