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