$content_type = ($public_batch ? "application/magic-envelope+xml" : "application/json");
- $postResult = DI::httpRequest()->post($dest_url, $envelope, ["Content-Type: " . $content_type]);
+ $postResult = DI::httpRequest()->post($dest_url, $envelope, ['Content-Type' => $content_type]);
$xml = $postResult->getBody();
$curl_stat = $postResult->getReturnCode();
return -9; // timed out
}
- if (($curl_stat == 503) && (stristr($postResult->getHeader(), 'retry-after'))) {
+ if (($curl_stat == 503) && $postResult->inHeader('retry-after')) {
return -10;
}
}
$event_id = Event::store($ev);
- Logger::log("Event ".$event_id." was stored", Logger::DEBUG);
- return;
+ Logger::info('Event was stored', ['id' => $event_id]);
+
+ $item = Event::getItemArrayForImportedId($event_id, $item);
}
}
}