17 require_once SQ_PACKAGES_PATH.
'/web_services/rest/page_templates/page_rest_resource/page_rest_resource.inc';
33 private $_response_headers = Array(
50 parent::__construct($assetid);
67 if (!empty($this->_res[
'responses'])) {
70 foreach ($this->_res[
'responses'] as &$resp) {
71 if ($resp[
'info'][
'http_code'] < 400) {
72 $body = $resp[
'body'];
73 if (strpos($body,
'<!--rest-asset-head-body-separator-->') !== FALSE) {
74 $body_parts = explode(
'<!--rest-asset-head-body-separator-->', $body);
84 public function printBody()
89 if (!empty($this->_res[
'responses'])) {
90 if ($this->
attr(
'send_headers')) {
91 foreach ($this->_response_headers as $h) {
92 if (isset($this->_res[
'response'][
'headers'][$h])) {
93 header(
"$h: " . $this->_res[
'response'][
'headers'][$h]);
100 foreach ($this->_res[
'responses'] as &$resp) {
101 if ($resp[
'info'][
'http_code'] >= 400) {
102 echo $this->
attr(
'error_response');
104 $body = $resp[
'body'];
105 if (strpos($body,
'<!--rest-asset-head-body-separator-->') !== FALSE) {
106 $body_parts = explode(
'<!--rest-asset-head-body-separator-->', $body);