Annotation of parser3/tests/346-curl.html, revision 1.6
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] ] }
! 15: 9. ^try-catch{ ^curl:options[ $.no-such-option[] ] }
! 16: 10. ^try-catch{ ^curl:info[no-such-info] }
! 17: 11. ^json:string[^curl:info[]]
1.3 moko 18:
19: ^curl:options[
20: $.url[http://www.parser.ru/_/tests/readme]
21: $.timeout(5)
22: ]
23:
1.6 ! moko 24: 12. $f[^curl:load[
1.3 moko 25: $.range[4-]
26: ]]
27:
28: $f.text $f.CONTENT-RANGE
29:
1.6 ! moko 30: 13. $f[^curl:load[
1.3 moko 31: $.range[33-]
32: ]]
33:
34: $f.text $f.CONTENT-RANGE
35: }
36:
1.6 ! moko 37: 14. ^show[text;
1.3 moko 38: $.postfields[test]
39: $.useragent[^taint[parser 3]]
40:
41: $.name[test.txt]
42: $.mode[binary]
43: $.content-type[something/text]
1.4 moko 44: ]
1.3 moko 45:
1.6 ! moko 46: 15. ^show[binary;
1.3 moko 47: $.postfields[^file::load[binary;155.cfg]]
1.4 moko 48: ]
49:
1.6 ! moko 50: 16. ^show[empty post;
1.4 moko 51: $.httppost[]
52: ]
1.3 moko 53:
1.6 ! moko 54: 17. ^try-catch{ ^curl:load[ $.url[http://no-such-domain.parser.ru/] ] }
1.3 moko 55:
1.5 moko 56: @show[title;options][f;text;t;post]
1.4 moko 57:
58: $f[^curl:load[
59: $options
60: $.timeout(5)
61: $.url[http://www.parser.ru/_/tests/223.pl]
62: ]]
63:
1.3 moko 64: $title : {
65: "name":"$f.name",
66: "size":$f.size,
67: "mode":"$f.mode",
68: "content-type":"^taint[json;$f.content-type]",
1.1 moko 69: }
1.3 moko 70:
71: $text[^taint[as-is][$f.text]]
72: # cut off the post's body is any
73: $text[^text.match[POST:(.*)<EOF>][]{$post[$match.1]}]
74:
75: # create table with http headers
76: $t[^table::create[nameless]{^taint[as-is][^text.replace[^table::create{a b
77: = ^taint[^#09]
78: ^taint[^#0A] ^taint[^#0A]}]]}]
79: ^t.sort{$t.0}
80:
81: # print all
82: <h3>Headers</h3>
83: <pre>^t.menu{$t.0 : $t.1}[^#0A]</pre>
84:
85: <h3>Body</h3>
86: <pre>^taint[as-is][$post]</pre>
87: <hr />
E-mail: