Annotation of parser3/tests/346-curl.html, revision 1.10
1.3 moko 1: @main[]
2:
1.6 moko 3: 1. ^try-catch{ ^curl:info[] }
4: 2. ^try-catch{ ^curl:options[ $.charset[UTF-8] ] }
5: 3. ^try-catch{ ^curl:options[ $.url[http://parser.ru/] ] }
1.2 moko 6:
1.6 moko 7: 4. ^curl:session{ $s[^curl:version[]] }
1.2 moko 8:
1.6 moko 9: 5. ^try-catch{ ^curl:options[ $.library[no-such-library.so] ] }
1.2 moko 10:
1.1 moko 11: ^curl:session{
1.6 moko 12: 6. ^try-catch{ ^curl:options[ $.url[ftp://parser.ru/] ] }
13: 7. ^try-catch{ ^curl:options[ $.httppost[ $.name[ $.hash[] ]] ] }
14: 8. ^try-catch{ ^curl:options[ $.httppost[string] ] }
1.7 moko 15: 8.1. ^try-catch{ ^curl:options[ $.httppost{code} ] }
16:
17: 8.2. ^try-catch{ ^curl:options[ $.httpheader[string] ] }
18: 8.3. ^try-catch{ ^curl:options[ $.httpheader{code} ] }
19: 8.4. ^try-catch{ ^curl:options[ $.httpheader{ } ] }
20:
1.6 moko 21: 9. ^try-catch{ ^curl:options[ $.no-such-option[] ] }
22: 10. ^try-catch{ ^curl:info[no-such-info] }
23: 11. ^json:string[^curl:info[]]
1.3 moko 24:
25: ^curl:options[
26: $.url[http://www.parser.ru/_/tests/readme]
27: $.timeout(5)
28: ]
29:
1.6 moko 30: 12. $f[^curl:load[
1.3 moko 31: $.range[4-]
32: ]]
33:
34: $f.text $f.CONTENT-RANGE
35:
1.6 moko 36: 13. $f[^curl:load[
1.3 moko 37: $.range[33-]
38: ]]
39:
40: $f.text $f.CONTENT-RANGE
1.9 moko 41:
42: 13.1. ^try-catch{ ^curl:options[ $.http_version[unknown] ] }
43: 13.2. ^try-catch{ ^curl:options[ $.http_version[1.0] ] }
1.3 moko 44: }
45:
1.6 moko 46: 14. ^show[text;
1.3 moko 47: $.postfields[test]
48: $.useragent[^taint[parser 3]]
49:
50: $.name[test.txt]
51: $.mode[binary]
52: $.content-type[something/text]
1.4 moko 53: ]
1.3 moko 54:
1.6 moko 55: 15. ^show[binary;
1.3 moko 56: $.postfields[^file::load[binary;155.cfg]]
1.4 moko 57: ]
58:
1.8 moko 59: ^curl:session{
60:
1.6 moko 61: 16. ^show[empty post;
1.8 moko 62: $.post(true)
63: ]
64:
65: 17. ^show[empty get;
1.4 moko 66: $.httppost[]
1.8 moko 67: $.post(false)
68: ]
69:
70: }
71:
72: 18. ^show[empty custompost;
73: $.customrequest[POST]
1.4 moko 74: ]
1.3 moko 75:
1.10 ! moko 76: 19. ^try-catch-filtered{ ^curl:load[ $.url[http://no-such-domain.parser.ru/] ] }
1.3 moko 77:
1.5 moko 78: @show[title;options][f;text;t;post]
1.4 moko 79:
80: $f[^curl:load[
81: $options
82: $.timeout(5)
83: $.url[http://www.parser.ru/_/tests/223.pl]
84: ]]
85:
1.3 moko 86: $title : {
87: "name":"$f.name",
88: "size":$f.size,
89: "mode":"$f.mode",
90: "content-type":"^taint[json;$f.content-type]",
1.1 moko 91: }
1.3 moko 92:
93: $text[^taint[as-is][$f.text]]
94: # cut off the post's body is any
95: $text[^text.match[POST:(.*)<EOF>][]{$post[$match.1]}]
96:
97: # create table with http headers
98: $t[^table::create[nameless]{^taint[as-is][^text.replace[^table::create{a b
99: = ^taint[^#09]
100: ^taint[^#0A] ^taint[^#0A]}]]}]
101: ^t.sort{$t.0}
102:
103: # print all
104: <h3>Headers</h3>
105: <pre>^t.menu{$t.0 : $t.1}[^#0A]</pre>
106:
107: <h3>Body</h3>
108: <pre>^taint[as-is][$post]</pre>
109: <hr />
E-mail: