nodejs httprequest with data - getting error getaddrinfo ENOENT

后端 未结 8 1609
天命终不由人
天命终不由人 2020-12-02 22:47

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

相关标签:
8条回答
  • 2020-12-02 23:28

    The problem can also happen if you have a trailing slash:

    Good: "www.google.com"

    Bad: "www.google.com/"

    0 讨论(0)
  • 2020-12-02 23:29

    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 讨论(0)
提交回复
热议问题