Annotation of parser3/tests/223-curl.html, revision 1.3
1.1 moko 1: @main[]
2: $hHeader[
3: $.[my-name][^taint[as-is][ЗнА^#0A^#0AчЕ&н"И:е%]]
4: $.[^#0A^taint[as-is][^#0Aфыв]][зна^#0Aчение]
5: ]
6:
1.2 moko 7: $hForm[^hash::create[$hHeader]
8: $.table[^table::create{value
9: value
10: значение}]
11: ]
1.1 moko 12:
13: ^do[POST in ^$response:charset (UTF-8) w/o file;;$hForm]
14:
15: ^do[POST in UTF-8 w/o file with own User-Agent and ommiting charset declaration;UTF-8;$hForm;Мой-^taint[as-is][Странный]-User-Agent](true)
16:
17: ^do[POST in WINDOWS-1251 w/o file;WINDOWS-1251;$hForm]
18:
19: ^do[POST in ^$response:charset (UTF-8) with file in UTF-8;;
20: ^hash::create[$hForm]
21: $.file[^file::load[binary;223_utf8.txt]]
22: ]
23:
24: ^do[POST in WINDOWS-1251 with file in UTF-8;WINDOWS-1251;
25: ^hash::create[$hForm]
26: $.file[^file::load[binary;223_utf8.txt;фай^#0Aл.html]]
27: ]
28:
29: ^do[POST in WINDOWS-1251 with file in WINDOWS-1251;WINDOWS-1251;
30: ^hash::create[$hForm]
31: $.file[^file::load[binary;223_win1251.txt]]
32: ]
33:
34: ^do[Binary file post;WINDOWS-1251;
35: $file[^file::load[binary;103mark.gif]]
36: $.file[$file] $.file_1[$file] $.file_2[$file] $.file_3[$file] $.file_4[$file]
37: ]
38:
39: @do[sTitle;sCharset;hForm;sUserAgent;bOmmitPostCharset][f;text;t;post]
40: <h2>$sTitle</h2>
41: $f[^curl:load[
42: $.url[http://www.parser.ru/_/tests/223.pl]
43: $.timeout(5)
44:
45: $.httppost[$hForm]
46: $.httpheader[
47: ^hash::create[$hHeader]
48: ^if(def $sUserAgent){
49: $.user-agent[$sUserAgent]
50: }
51: ]
52:
53: ^if(def $sCharset){
54: $.charset[$sCharset]
55: }
56: ]]
57:
58: #<pre>$f.text</pre>
59:
60: $text[^taint[as-is][$f.text]]
61: # replace boundary by fixed string
1.3 ! moko 62: $text[^text.match[(-{12})-*[0-9a-zA-Z]+(--)?][g]{${match.1}boundary-value$match.2}]
1.1 moko 63: # cut off the post's body is any
64: $text[^text.match[POST:(.*)<EOF>][]{$post[$match.1]}]
65:
66: # create table with http headers
67: $t[^table::create[nameless]{^taint[as-is][^text.replace[^table::create{a b
68: = ^taint[^#09]
69: ^taint[^#0A] ^taint[^#0A]}]]}]
1.3 ! moko 70: $t[^t.select($t.0 ne 'CONTENT_LENGTH')]
1.1 moko 71: ^t.sort{$t.0}
72:
73: # print all
74: <h3>Headers</h3>
75: <pre>^t.menu{$t.0 : $t.1}[^#0A]</pre>
76:
77: <h3>Body</h3>
78: <pre>^taint[as-is][$post]</pre>
79: <hr />
E-mail: