1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
<tt>
<html><br>
<head><br>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><br>
</head><br>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><br>
<div> Cowboy aims to use binaries, not strings, and unless there's a change in the head branch I don't have, the returned tuple has only two values, the value and the request. So it should look like something like - </div><br>
<div><br><br>
</div><br>
<div> {Value, Req2} = cowboy_req:header(<<"user-agent">>, Req)</div><br>
<div><br><br>
</div><br>
<div><br><br>
</div><br>
<div><br><br>
</div><br>
<div><br><br>
</div><br>
<span id="OLK_SRC_BODY_SECTION"><br>
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><br>
<span style="font-weight:bold">From: </span>������ �������� <<a href="mailto:[email protected]">[email protected]</a>><br><br>
<span style="font-weight:bold">Date: </span>Sunday, March 17, 2013 9:22 AM<br><br>
<span style="font-weight:bold">To: </span>"<a href="mailto:[email protected]">[email protected]</a>" <<a href="mailto:[email protected]">[email protected]</a>><br><br>
<span style="font-weight:bold">Subject: </span>[99s-extend] cowboy header<br><br>
</div><br>
<div><br><br>
</div><br>
<div><br>
<div><br>
<div>Hello tell me how I can get for example http header "user-agent"?</div><br>
<div>I do so:</div><br>
<div> </div><br>
<div>handle(Req, State) -></div><br>
<div> </div><br>
<div>{ok, FwdIP, Req5} = cowboy_req:header("user-agent, Req)</div><br>
<div> </div><br>
<div>but in this place I get the error</div><br>
<div> </div><br>
<div> </div><br>
<div> </div><br>
<div>--</div><br>
<div>Vjacheslav Kozlov</div><br>
<div>Engineer of AEMS</div><br>
<div>Ltd. "EER-Novomichurinsk"</div><br>
<div>--</div><br>
<div><a href="http://www.ter-energo.ru">http://www.ter-energo.ru</a></div><br>
<div>+79109095144 09:00-18:00 (GMT+04:00)</div><br>
</div><br>
</div><br>
</span><br>
</body><br>
</html><br>
</tt>
|