Annotation of parser3/tests/346-curl.html, revision 1.8
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
41: }
42:
1.6 moko 43: 14. ^show[text;
1.3 moko 44: $.postfields[test]
45: $.useragent[^taint[parser 3]]
46:
47: $.name[test.txt]
48: $.mode[binary]
49: $.content-type[something/text]
1.4 moko 50: ]
1.3 moko 51:
1.6 moko 52: 15. ^show[binary;
1.3 moko 53: $.postfields[^file::load[binary;155.cfg]]
1.4 moko 54: ]
55:
1.8 ! moko 56: ^curl:session{
! 57:
1.6 moko 58: 16. ^show[empty post;
1.8 ! moko 59: $.post(true)
! 60: ]
! 61:
! 62: 17. ^show[empty get;
1.4 moko 63: $.httppost[]
1.8 ! moko 64: $.post(false)
! 65: ]
! 66:
! 67: }
! 68:
! 69: 18. ^show[empty custompost;
! 70: $.customrequest[POST]
1.4 moko 71: ]
1.3 moko 72:
1.8 ! moko 73: 19. ^try-catch{ ^curl:load[ $.url[http://no-such-domain.parser.ru/] ] }
1.3 moko 74:
1.5 moko 75: @show[title;options][f;text;t;post]
1.4 moko 76:
77: $f[^curl:load[
78: $options
79: $.timeout(5)
80: $.url[http://www.parser.ru/_/tests/223.pl]
81: ]]
82:
1.3 moko 83: $title : {
84: "name":"$f.name",
85: "size":$f.size,
86: "mode":"$f.mode",
87: "content-type":"^taint[json;$f.content-type]",
1.1 moko 88: }
1.3 moko 89:
90: $text[^taint[as-is][$f.text]]
91: # cut off the post's body is any
92: $text[^text.match[POST:(.*)<EOF>][]{$post[$match.1]}]
93:
94: # create table with http headers
95: $t[^table::create[nameless]{^taint[as-is][^text.replace[^table::create{a b
96: = ^taint[^#09]
97: ^taint[^#0A] ^taint[^#0A]}]]}]
98: ^t.sort{$t.0}
99:
100: # print all
101: <h3>Headers</h3>
102: <pre>^t.menu{$t.0 : $t.1}[^#0A]</pre>
103:
104: <h3>Body</h3>
105: <pre>^taint[as-is][$post]</pre>
106: <hr />
E-mail: