Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added curl test.

  • Loading branch information...
commit 660e53c94b1d523a3d26b429a5cb7de2c85148ad 1 parent bf2a306
@davidwhitney davidwhitney authored
Showing with 32 additions and 0 deletions.
  1. +29 −0 PHP/curltest.php
  2. +3 −0  PHP/phpinfo.php
View
29 PHP/curltest.php
@@ -0,0 +1,29 @@
+<?php
+
+ echo "pre_init<br/>";
+
+ $ch = curl_init("http://www.google.com");
+
+echo "post_init<br/>";
+
+ curl_setopt($ch, CURLOPT_HEADER, false);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+
+echo "post_setopt<br/>";
+echo "pre_exec<br/>";
+
+ $result = curl_exec($ch);
+ $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+ $type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
+ curl_close($ch);
+
+echo "post_close<br/>";
+
+echo "result: <br/>";
+
+echo $result;
+ //if (!strstr($type, 'application/json')) {
+ // throw new HttpResponseException('JSON response not found');
+ //}
+
+ //return new HttpResponse($code, $result);
View
3  PHP/phpinfo.php
@@ -0,0 +1,3 @@
+<?php
+phpinfo();
+?>
Please sign in to comment.
Something went wrong with that request. Please try again.