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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:52:59+00:00 2026-05-24T16:52:59+00:00

Node’s HTTP module is not returning all the expected data from this URL: http://itradedata.co.za/pmchart/prices/GetPricesTRI.asp?Shortname=ACE&numprices=5

  • 0

Node’s HTTP module is not returning all the expected data from this URL: http://itradedata.co.za/pmchart/prices/GetPricesTRI.asp?Shortname=ACE&numprices=5

There are 5 price records when viewing in a browser, but only one in Node’s HTTP GET data. Packet sniffing shows all the data going in, so why is it not in the output?

var http = require('http'),
    host = 'itradedata.co.za',
    records = 5,
    url = '/pmchart/prices/GetPricesTRI.asp?Shortname=ACE&numprices=' + records,
    client = http.createClient(80, host),
    headers = { 'host': host },
    req;

req = client.request('GET', url, headers);
req.on('response', function(res) {
    console.log(res.statusCode);
    res.on('data', function (chunk) {
        console.log(chunk.toString());
    });
});
req.end();

The problem seems to be in the way the server returns data… cURL also does not show the data when running curl {url} in terminal, but it writes everything to file when using curl {url} -o {file}. What is going on here?

Expected result:

# Attempting to get 5 prices for theTicker: ACE<BR>
# Trying JSECODE<BR>
# Sending prices for Entity_ID: 17352 Shortname:  ShareID:  JSECode: <BR>
2011-8-15,46,46,46,46,0,08268
2011-8-12,46,46,46,46,51,0068
2011-8-11,46,46,46,46,51,0068
2011-8-10,46,46,46,46,51,0068
2011-8-8,46,46,46,46,51,00068

Actual result:

# Attempting to get 5 prices for theTicker: ACE<BR>
# Trying JSECODE<BR>
# Sending prices for Entity_ID: 17352 Shortname:  ShareID:  JSECode: <BR>
2011-8-8,46,46,46,46,51,00068

The four missing records are in the middle of the result.

  • 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-24T16:52:59+00:00Added an answer on May 24, 2026 at 4:52 pm

    I’m relatively sure that it is because that site sends \r, but no \n.

    Buffer contents:

    2c 30 30 0d 32 30
    

    0d says “back to the begin of the line”, 0a says “next line”. So it always goes back, but never writes a new line. It just overwrites existing output.

    You could try replacing 0d with 0a to see everything.

    Edit: Tried it, it works. Code:

    req = client.request('GET', url, headers);
    req.on('response', function(res) {
        console.log(res.statusCode);
        res.on('data', function (chunk) {
            for (var i=0; i<chunk.length; i++)
                if (chunk[i] === 0xd) chunk[i] = 0xa
            console.log(chunk.toString());
        });
    });
    req.end();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

node.js doc says response.end([data], [encoding]) This method signals to the server that all of
With Node I am trying to collect user data from an LDAP server and
Node.js unit-testing module has basic assertion assert.fail: assert.fail(actual, expected, message, operator) What does operator
With node.js i can stream data to the client with its HTTP API. But
using node.js, the net module for building a tcp server which can hande http
Getting node.js and gridfs to play nice is not easy. Of all the things
class Node(object): def __init__(self, data): self.data = data if __name__ == __main__: a =
In Node.js is there any way to listen to all events emitted by an
In node.js vm module , i can execute some javascript in another node.js process.
Does Node.js have built-in Base64 encoding yet? The reason why I ask this is

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.