- examples fixup
[m6w6/ext-http] / docs / examples / GET_Queries.php
1 <?php
2 $r = new HttpRequest('http://www.google.com/search');
3
4 // store Googles cookies in a dedicated file
5 touch('google.txt');
6 $r->setOptions(
7 array( 'cookiestore' => 'google.txt',
8 )
9 );
10
11 $r->setQueryData(
12 array( 'q' => '+"pecl_http" -msg -cvs -list',
13 'hl' => 'de'
14 )
15 );
16
17 // HttpRequest::send() returns an HttpMessage object
18 // of type HttpMessage::RESPONSE or throws an exception
19 try {
20 print $r->send()->getBody();
21 } catch (HttpException $e) {
22 print $e;
23 }
24 ?>