public Budabot\Core\AsyncHttp
Budabot\Core\AsyncHttp
get( string $uri )
Requests contents of given $uri using GET method and returns AsyncHttp object which has additional methods for controlling how the query is done.
You can get both HTTP and HTTPS URIs with method.
For more info, see AsyncHttp class.
Asynchronous example:
$this->http->get("http://www.google.com/")->withCallback(function($response) { print $response->body; });
Synchronous example:
$response = $this->http->get("http://www.google.com/")->waitAndReturnResponse(); print $response->body;
post( string $uri )
Requests contents of given $uri using POST method and returns AsyncHttp object which has additional methods for controlling how the query is done.
See get() for code example.
public