I am French and no one in English so everything is translated by google! I am a beginner on NODE.
In my index.html file, there is a form that I send to the server via $ .ajax with the POST method
To retrieve this form on the server
app.post('/connexion', function (req, res) {
var postData = '';
var pathname = url.parse(req.url).pathname;
console.log('Reçue: '+ pathname +' .');
req.setEncoding('utf8');
req.addListener('data', function(postDataChunk) {
postData += postDataChunk;
console.log('POST reçu ' + postDataChunk +'.');
});
and on the console, I receive this in return
Reçue: /connexion .
POST reçu -----------------------------4511735334446617171533446239
Content-Disposition: form-data; name="pseudo"
Nath
-----------------------------4511735334446617171533446239
Content-Disposition: form-data; name="mdp"
moi
-----------------------------4511735334446617171533446239--
.
But I do not find how to retrieve the values of the variables pseudo and mdp.
Can you help me understand and recover these values?
Thank you for your help
</div>