Created
November 8, 2016 13:41
-
-
Save solomax/f5bc9433e41ec30c2ac384e7c483d3a5 to your computer and use it in GitHub Desktop.
OM PHP API POST test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$options = array ( | |
CURLOPT_RETURNTRANSFER => true // return web page | |
, CURLOPT_HEADER => false // return headers | |
, CURLOPT_FOLLOWLOCATION => true // follow redirects | |
, CURLOPT_ENCODING => "" // handle all encodings | |
, CURLOPT_USERAGENT => "openmeetings" // who am i | |
, CURLOPT_AUTOREFERER => true // set referer on redirect | |
, CURLOPT_CONNECTTIMEOUT => 120 // timeout on connect | |
, CURLOPT_TIMEOUT => 120 // timeout on response | |
, CURLOPT_MAXREDIRS => 10 // stop after 10 redirects | |
//, CURLOPT_SSL_VERIFYPEER => false // Disabled SSL Cert checks | |
//, CURLOPT_SSL_VERIFYHOST => false // Disables hostname verification | |
); | |
$options[CURLOPT_POST] = true; | |
$session = curl_init('https://om.alteametasoft.com/openmeetings/services/group/?sid=xxx-xxx-xxxx-xxxxx&name=test'); | |
curl_setopt_array($session, $options); | |
$response = curl_exec($session); | |
if ($response === false) { | |
$err = curl_errno($session); | |
$errmsg = curl_error($session); | |
$info = curl_getinfo($session); | |
curl_close($session); | |
$this->error = true; | |
$this->message = 'Request OpenMeetings! OpenMeetings Service failed and no response was returned. Additioanl info: ' . var_export($info); | |
return; | |
} | |
//TODO FIXME check status | |
curl_close($session); | |
var_dump($response); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment