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 = []) {
$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}(
Text::insert($path, $insert, ['clean' => true]),
$data + (array) $query->conditions() + ['limit' => $query->limit()],
(array) $options
);
}