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 6125499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:15:18+00:00 2026-05-23T16:15:18+00:00

I have a client that is sending data chunks to my node.js server. I

  • 0

I have a client that is sending data chunks to my node.js server.

I want to listen on the “end” event and retrieve the accumulated request body.

Here is my code:

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

  req.on('end', function() { // WHY IS THIS NEVER FIRED?
    console.log(req.body);

    res.send({
      "status": "ok"
    });

  });

});

The problem is that the ‘end’ event is never fired.

Anyone knows why?

Also, if I do in this way, will the req.body be the accumulated body of all the body chunks?

  • 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-23T16:15:19+00:00Added an answer on May 23, 2026 at 4:15 pm

    Basically http POST only fires when you POST to the server. I can’t be certain, but I’m assuming you are just attempting to visit server:port/users in your web browser and fail to get a response. By default the web browser is GETing the server. To fix this you have two options.

    1. If you change app.post to app.get the event will correctly fire when you visit /users

    2. Or you can fire the post function using a form. For example the following code will display a form if you visit the page using GET. When you submit the form it will fire POST.

    var express = require('express'),
        app = express.createServer();
    
    app.listen(1337, "127.0.0.1");
    
    app.get('/users',function(req,res){
      res.send('<form method="post" action="/users"><input type="submit" value="Submit" /></form>');
    })
    
    app.post('/users', function(req, res){
      req.on('end', function() {
        console.log('success');
        res.send('success!!!');
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a client application which is sending a request to a server. Server
I have a client-server program. I'm sending data like this: private void Sender(string s,TcpClient
We have a Java client that sending us some encrypted data 1. A random
I have a client-side script written in jQuery that is sending text/xml data to
I have client application that uses WCF service to insert some data to backend
I have a problem with an J2ME client app, that sends data to an
I have a socket server, written in C++ using boost::asio, and I'm sending data
I have an internal proxy that fetches data from my own server and displays
I have got a Client/Server Application that using Asynchronous Socket.My problem is i cant
Python 2.7, Windows XP. I have a server that sends messages to client(s). I

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.