@@ 91-100 (lines=10) @@ | ||
88 | $hal->setData($hal->getData() + array('_system_errors' => $system_errors)); |
|
89 | ||
90 | } |
|
91 | if(isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos(strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'xml') !== false) |
|
92 | { |
|
93 | header('Content-Type: application/hal+xml'); |
|
94 | return $hal->asXml(true); |
|
95 | } |
|
96 | else |
|
97 | { |
|
98 | header('Content-Type: application/hal+json'); |
|
99 | return $hal->asJson(true); |
|
100 | } |
|
101 | } |
|
102 | ||
103 | /** |
|
@@ 127-136 (lines=10) @@ | ||
124 | } |
|
125 | ||
126 | $this->sendHeaders(); |
|
127 | if(isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos(strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'xml') !== false) |
|
128 | { |
|
129 | header('Content-Type: application/problem+xml'); |
|
130 | return $problem->asXml(true); |
|
131 | } |
|
132 | else |
|
133 | { |
|
134 | header('Content-Type: application/problem+json'); |
|
135 | return $problem->asJson(true); |
|
136 | } |
|
137 | } |
|
138 | } |