angularjs - http post password to node.js server from angular -


this bugging me. know can following:

$http.post('https://url:8080/api/registeruser?username=' + usrname + '&usrpassword=' + usrpassword); 

but i'm guessing isn't right way of passing password server. i've tried this:

$http({     method: 'post',     url: url2,     data: {         username: encodeuricomponent(usrname),          userpassword: encodeuricomponent(usrpassword)     },     headers: { 'content-type': 'application/x-www-form-urlencoded' } }); 

but can't find data anywhere on req in node.js when receives it. doing wrong here?

you can find:

  • post data on req.body
  • get parameters on req.query
  • route parameters on req.params

req.body.username example


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -