2 HttpRequest multiple posts
6 checkcls('HttpRequest');
13 array('int' => 1, 'dbl' => M_PI),
14 array('str' => 'something', 'nil' => null)
17 echo "\nFirst Request\n";
18 $r = new HttpRequest('http://dev.iworks.at/.print_request.php', HttpRequest::METH_POST);
19 $r->setPostFields($fields[0]);
20 $r->addPostFields($fields[1]);
21 var_dump($r->send()->getBody());
24 echo "\nSecond Request\n";
25 $r->setPostFields($fields);
26 var_dump($r->send()->getBody());
29 echo "\nThird Request\n";
30 $r->addPostFields(array('x' => 'X'));
31 var_dump($r->send()->getBody());
34 echo "\nFourth Request\n";
35 $r->setPostFields(array());
36 var_dump($r->send()->getBody());
48 [dbl] => 3.1415926535898
52 string(44) "int=1&dbl=3.1415926535898&str=something&nil="
60 float(3.1415926535898)
77 [dbl] => 3.1415926535898
87 string(72) "0%5Bint%5D=1&0%5Bdbl%5D=3.1415926535898&1%5Bstr%5D=something&1%5Bnil%5D="
95 float(3.1415926535898)
100 string(9) "something"
112 [dbl] => 3.1415926535898
123 string(76) "0%5Bint%5D=1&0%5Bdbl%5D=3.1415926535898&1%5Bstr%5D=something&1%5Bnil%5D=&x=X"
131 float(3.1415926535898)
136 string(9) "something"
143 string(13) "string(0) ""
151 float(3.1415926535898)
156 string(9) "something"