private function parse_shortcut_args($args)
{
if (count($args) == 0) {
$body = null;
$headers = array();
}
if (count($args) == 1) {
// http headers or body only received
if (is_array($args[0])) {
// http headers only
$headers = $args[0];
$body = null;
} else {
// body only
$body = $args[0];
$headers = array();
}
} elseif (count($args) == 2) {
// body and http headers both received
if (is_array($args[0])) {
// header first
$body = $args[1];
$headers = $args[0];
} else {
// body first
$body = $args[0];
$headers = $args[1];
}
}
return array($headers, $body);
}