lithium\data\source\Http::send()
Method to send to a specific resource.
Parameters
-
array
$query
a query object
-
array
$options
array.
Returns
mixedSource
public function send($query = null, array $options = array()) {
$query = !is_object($query) ? new Query((array) $query) : $query;
$method = $query->method() ?: "get";
$path = $query->path();
$data = $query->data();
$insert = (array) $options + $data + $query->export($this);
if (preg_match_all('/\{:(\w+)\}/', $path, $matches)) {
$data = array_diff_key($data, array_flip($matches[1]));
}
return $this->connection->{$method}(
String::insert($path, $insert, array('clean' => true)),
$data + (array) $query->conditions() + array('limit' => $query->limit()),
(array) $options
);
}