123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- include('../library/Requests.php');
- Requests::register_autoloader();
- $requests = array(
- array(
- 'url' => 'http://httpbin.org/get',
- 'headers' => array('Accept' => 'application/javascript'),
- ),
- 'post' => array(
- 'url' => 'http://httpbin.org/post',
- 'data' => array('mydata' => 'something'),
- ),
- 'delayed' => array(
- 'url' => 'http://httpbin.org/delay/10',
- 'options' => array(
- 'timeout' => 20,
- ),
- ),
- );
- function my_callback(&$request, $id) {
- var_dump($id, $request);
- }
- $options = array(
- 'complete' => 'my_callback',
- );
- $responses = Requests::request_multiple($requests, $options);
|