Annotation of parser3/tests/346-curl.html, revision 1.5

1.3       moko        1: @main[]
                      2: 
1.2       moko        3: ^try-catch{ ^curl:info[] }
                      4: ^try-catch{ ^curl:options[ $.charset[UTF-8] ] }
                      5: ^try-catch{ ^curl:options[ $.url[http://parser.ru/] ] }
                      6: 
                      7: ^curl:session{ $s[^curl:version[]] }
                      8: 
                      9: ^try-catch{ ^curl:options[ $.library[no-such-library.so] ] }
                     10: 
1.1       moko       11: ^curl:session{
1.3       moko       12:        ^try-catch{ ^curl:options[ $.url[ftp://parser.ru/] ] }
                     13:        ^try-catch{ ^curl:options[ $.httppost[ $.name[ $.hash[] ]] ] }
1.4       moko       14:        ^try-catch{ ^curl:options[ $.httppost[string] ] }
1.3       moko       15:        ^try-catch{ ^curl:options[ $.no-such-option[] ] }
                     16:        ^try-catch{ ^curl:info[no-such-info] }
                     17:        ^json:string[^curl:info[]]
                     18: 
                     19:        ^curl:options[
                     20:                $.url[http://www.parser.ru/_/tests/readme]
                     21:                $.timeout(5)
                     22:        ]
                     23: 
                     24:        $f[^curl:load[
                     25:                $.range[4-] 
                     26:        ]]
                     27: 
                     28:        $f.text $f.CONTENT-RANGE
                     29: 
                     30:        $f[^curl:load[
                     31:                $.range[33-]
                     32:        ]]
                     33: 
                     34:        $f.text $f.CONTENT-RANGE
                     35: }
                     36: 
1.4       moko       37: ^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.4       moko       46: ^show[binary;
1.3       moko       47:        $.postfields[^file::load[binary;155.cfg]]
1.4       moko       48: ]
                     49: 
                     50: ^show[empty post;
                     51:        $.httppost[]
                     52: ]
1.3       moko       53: 
                     54: ^try-catch{ ^curl:load[ $.url[http://no-such-domain.parser.ru/] ] }
                     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: