Skip to Content
한 권으로 끝내는 Node & Express: 웹사이트 구축을 위한 서버 사이드 자바스크립트
book

한 권으로 끝내는 Node & Express: 웹사이트 구축을 위한 서버 사이드 자바스크립트

by 한성용, 이선 브라운
April 2016
Beginner to intermediate
389 pages
9h 8m
Korean
Hanbit Media, Inc.
Content preview from 한 권으로 끝내는 Node & Express: 웹사이트 구축을 위한 서버 사이드 자바스크립트
127
8
-
폼 처리
사용자에게서 정보를 받을 때는 보통
HTML
을 사용합니다. 브라우저에서 일반적 방법으로
폼을 전송하든,
AJAX
를 사용하든, 멋진 프론트엔드 컨트롤을 사용하든 간에, 근본적인 메커니
즘은 대부분
HTML
폼입니다. 이 장에서는 폼을 처리하고 유효성을 검사하며 파일을 업로드는
방법을 살펴봅니다.
8.1.
클라이언트 데이터를 서버로 보내기
클라이언트 데이터를 서버에 보내는 방법은 크게 말해 쿼리스트링과 요청 본문입니다. 일반적
으로 쿼리스트링을 쓸 때는
GET
요청을, 요청 본문을 쓸 때는
POST
요청을 사용합니다(
HTTP
프로토콜에 어떤 제한이 있는 건 아니므로 두 요청을 반대로 해도 안 될 건 없지만, 그렇게 할
이유는 전혀 없습니다. 표준 관행을 따르는 편이 가장 좋습니다).
POST
는 안전하고
GET
은 그렇지 않다고 오해하는 사람이 많은데 그렇지 않습니다.
HTTPS
쓰면 둘 다 안전하고, 쓰지 않으면 어느 쪽도 안전하지 않습니다.
HTTPS
를 쓰지 않으면 침입자
GET
요청의 쿼리스트링과 똑같이 쉽게
POST
본문의 데이터를 볼 수 있습니다.
GET
요청을 쓰
면 숨긴 필드를 포함해 사용자가 입력한 내용이 모두 쿼리스트링에 나타나는데, 보기도 좋지 않
고 문제도 많습니다. 또한 브라우저는 대개 쿼리스트링 길이에 제한을
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

한 권으로 끝내는 Node & Express(2판): 모던 웹을 위한 서버 사이드 자바스크립트의 모든 것

한 권으로 끝내는 Node & Express(2판): 모던 웹을 위한 서버 사이드 자바스크립트의 모든 것

한선용, 이선 브라운

Publisher Resources

ISBN: 9788968482229