> On Jan 27, 2015, at 3:04 AM, Tushar Jain <[email protected]> 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

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/BC0094A8-B45A-4892-9EBF-29500515A6E8%40nbtsc.org.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to