- add missing support for raw post data (HttpRequest)
[m6w6/ext-http] / docs / examples / GET_Queries.php
diff --git a/docs/examples/GET_Queries.php b/docs/examples/GET_Queries.php
new file mode 100644 (file)
index 0000000..cb21cb6
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+$r = new HttpRequest('http://www.google.com');
+
+// store Googles cookies in a dedicated file
+$r->setOptions(
+       array(  'cookiestore'   => '../cookies/google.txt',
+       )
+);
+
+$r->setQueryData(
+       array(  'q'             => '+"pecl_http" -msg -cvs -list',
+                       'hl'    => 'de'
+       )
+);
+
+// HttpRequest::send() returns an HttpMessage object
+// of type HttpMessage::RESPONSE or throws an exception
+try {
+       print $r->send()->getBody();
+} catch (HttpException $e) {
+       print $e;
+}
+?>