의 스페인어 버전을 요청할 겁니다. 브라우저, 운영체제, 하드웨어 등의 ‘사용자 에이전트’ 정
보와 기타 소소한 정보도 보냅니다. 이 정보는 모두 요청 헤더의 형태로 전달되며, 요청 객체
의
headers
프로퍼티에서 이 정보를 볼 수 있습니다. 아주 단순한 익스프레스 라우트를 만들어
브라우저가 어떤 정보를 보내는지 볼 수 있습니다.
app
.
get
('/
headers
',
function
(
req
,
res
){
res
.
set
('
Content
-
Type
','
text
/
plain
');
var s
=
'';
for
(
var name in req
.
headers
)
s
+=
name
+
':
'
+
req
.
headers
[
name
]
+
'\
n
';
res
.
send
(
s
);
});
6.4.
응답 헤더
브라우저가 요청 헤더 형태로 서버에 정보를 보내는 것과 마찬가지로, 서버는 응답할 때 브라
우저가 화면에 렌더링하거나 표시하지 않는 정보를 보냅니다. 응답 헤더에는 일반적으로 메타
데이터와 서버 정보가 포함됩니다. 전송 중인 콘텐츠 종류(
HTML
, 이미지,
CSS
, 자바스크립
트 등)를 브라우저에 알리는
Content
-
Type
헤더는 이미 본 적이 있습니다. 브라우저는
URL
경로보다
Content
-
Type
헤더를 더 우선시합니다. 즉
/
image ...
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.
O’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
I 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
I’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
I'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.