$type = $this->response->getHeaders('content-type');
foreach ($this->handlers as $expr => $handler) {
if (preg_match('#^' . $expr . '$#i', $type)) {
- $body = call_user_func($handler, $body);
+ $handled = call_user_func($handler, $body);
+ if (!empty($handled)) {
+ $body = $handled;
+ }
}
}
public function post($url, array $query = array(),
array $post = array(), array $context = array()
) {
- if (!empty($params)) {
+ if (!empty($query)) {
$url .= '?' . http_build_query($query);
}
return $this->request($url, $context);
}
-}
+}
\ No newline at end of file