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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:16:17+00:00 2026-05-31T13:16:17+00:00

Update – Answered by self I see one has to make sure that the

  • 0

Update – Answered by self

I see one has to make sure that the DNS is resolved properly from the machine, check out the node documentation to make sure that domain is resolvable.

Original Question

i am writing a nodes based program,in which the user can ask me to do a httprequest on their behalf {off course they provide me with some data, and method to call with} but every time i do a httprequest it gives me an error

getaddrinfo ENOENT
this is how my code looks

function makehttprequest(deviceid, httpaction, httppath,methods, actiondata, callback) {
console.log('we are here with httpaction' + httpaction + ' path ' + httppath + ' method ' + methods + ' action data ' + actiondata);
 //do the http post work, get the data, and call the callback function with return data
 var options = {
   host: httpaction,
   port: 80,
   path: httppath,
   method: methods
 };

    try {
      var req = http.request(options, function(res) {
        console.log('STATUS: ' + res.statusCode);
        console.log('HEADERS: ' + JSON.stringify(res.headers));
        res.setEncoding('utf8');
        res.on('data', function (chunk) {
          console.log('BODY: ' + chunk);
        });
      });
    } catch(e) {
      console.log('error as : ' + e.message);
    }

    req.on('error', function(e) {
      console.log('problem with request: ' + e.message);
    });

    // write data to request body
    console.log('writing data to request ..');
    req.write(actiondata);
    console.log('finished writing data to request…');
    req.end();
    console.log('request ended…');
}
  • 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-31T13:16:17+00:00Added an answer on May 31, 2026 at 1:16 pm

    I’ve seen this happen when your host (which you pass in as httpaction) has the scheme (so “http://”) in front of it. Your host should strictly be the domain like “www.google.com” not “http://www.google.com” or “www.google.com/hello-world” or “http://www.google.com/hello-world“.

    Keep it just the domain.

    Here’s an example: http://allampersandall.blogspot.com/2012/03/nodejs-http-request-example.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Update : This is no longer an issue from C# 6, which has introduced
UPDATE Flexslider has a bunch of callback spaces for use which make this possible.
UPDATE UPI_ATTRIBUTE SET SITE_INC ='0' WHERE USER_PROFILING_NAME IN ('CAR_IMPLICIT','CAR_EXPLICIT') Above is my query that
UPDATE 6/21/12 I have a form in rails that is working similar to an
Update : I found almost exact similar question , yet it has slightly different
Update I want to have an expression (XPath, or Regex Expression, similar) that can
UPDATE: Solution at bottom. I recently switched from using a set up such as
UPDATE: An idea to make built-in strings non-iterable was proposed on python.org in 2006
Update Table1 set name = (select top 1 a.col from Table2 a where Table1.num
UPDATE 10 Secs later Fixed properly now, and thanks to JF and Gauden. UPDATE

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.