data

Web Programming/Node.js

Node.js POST 하기

이번에는 POST방식으로 전송했을 때 받는 법을 하겠다! 아래의 코드의 html 파일이 필요하다 여기서 action 을 정해준다. 여기에는 전송하고 싶은 URL를 적어주면 된다! 그다음 server.js에서 아래의 코드를 추가한다 else if (pathname === '/create') { dataAll = ''; request.on('data', function (data) { dataAll = dataAll + data; }); request.on('end', function () { var result = querystring.parse(dataAll); console.log(parsedQuery); response.writeHead(200); response.end(result.id + ' An..

INICO
'data' 태그의 글 목록