4 include_once
'./Services/WebServices/ECS/classes/class.ilECSConnector.php';
5 include_once
'./Services/WebServices/ECS/classes/class.ilECSConnectorException.php';
33 $ilLog->write(__METHOD__ .
': Add new course url ...');
35 $this->path_postfix =
'/campusconnect/course_urls';
40 $this->
addHeader(
'Content-Type',
'application/json');
41 $this->
addHeader(
'Accept',
'application/json');
44 $this->curl->setOpt(CURLOPT_HTTPHEADER, $this->
getHeader());
45 $this->curl->setOpt(CURLOPT_POST,
true);
46 $this->curl->setOpt(CURLOPT_POSTFIELDS, json_encode($url));
48 $GLOBALS[
'ilLog']->write(__METHOD__ .
': Sending url ' . print_r(json_encode($url),
true));
52 $info = $this->curl->getInfo(CURLINFO_HTTP_CODE);
54 $ilLog->write(__METHOD__ .
': Checking HTTP status...');
55 if (
$info != self::HTTP_CODE_CREATED) {
56 $ilLog->write(__METHOD__ .
': Cannot create course url ressource, did not receive HTTP 201. ');
57 $ilLog->write(__METHOD__ .
': POST was: ' . json_encode($url));
58 $ilLog->write(__METHOD__ .
': HTTP code: ' .
$info);
61 $ilLog->write(__METHOD__ .
': ... got HTTP 201 (created)');
__construct(ilECSSetting $settings=null)
Constructor.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
addUrl(ilECSCourseUrl $url, $a_target_mid)
Send url of newly created courses to ecs.
Connector for writing ecs course urls.
Represents a ecs course url.
addHeader($a_name, $a_value)
Add Header.
prepareConnection()
prepare connection