简体   繁体   中英

node.js registration: post data or sockets?

i have a small question, what is the better solution for registration to node.js: Send form in POST method, like a:

req.on('data', function(data) {
    console.log(data);
});

or send in sockets?

socket.emit("newUser", username, email, password)

Sockets are the better performance method, right? But POST method is more natural(?)... standard HTTP etc.. So... what do you think about this question, what is better to standard registration system?

I prefer to use normal post method and http module or express module to handle your requests

This will help you in controlling user sessions and help you to Choose your security methods.So shortly it will give you a better control on your application.

I like POST personally cause I can quickly use curl w/it..

curl --data "a=1&b=2" myhost.net/api

and posts are so easily handled within express or httpserver..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM