通过 Phalcon\Http\Client 我们可以发起 HTTP 请求。
<?php
use Phalcon\Http\Client\Adapter\Curl as Client;
// Create a client instance
$client = new Client();
// Or auto create
$client = Phalcon\Http\Client::factory();
// Send GET request
$response = $client->get('http://localhost/');
<?php
use Phalcon\Http\Client\Adapter\Curl as Client;
// Create a client instance
$client = new Client();
// Send POST request
$response = $client->post('http://localhost/auth/login', array('username' => 'test', 'password' => 'test'));