> On Jan 27, 2015, at 3:04 AM, Tushar Jain <
mytu...@gmail.com> wrote:
> I am trying to use NET module, but facing some error
> var socket = net.Socket();
[snip]
> socket.connect(80,"
https://www.google.com");
>
> I am getting getaddrinfo ENOTFOUND error. please let me know if you have any solution.
That's a URL, not a host name, so it's not looking up -- you want to connect to '
www.google.com' on port 80. (Also, for the record: you're not setting up TLS there, so you'll not be on a secure connection, it won't be https, and if it were, the port for https is 443. Yay complications!)
>
> Also how can i use NET module to send POST method request[I am not allowed to use HTTP module, have to do this using socket programming only]
That's a strange restriction -- homework for a programming course trying to make you understand a simple protocol?
The specification is in the HTTP RFC; in short, it's "POST path HTTP/1.1\r\n\Header: value\r\nHeader: value\r\n\r\nbodyhere", but there's plenty of details.
Aria