forked from quantum-php/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp_client.php
More file actions
34 lines (29 loc) · 714 Bytes
/
Copy pathhttp_client.php
File metadata and controls
34 lines (29 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* Quantum PHP Framework
* An open-source software development framework for PHP
* @link https://quantumphp.io
*/
use Quantum\HttpClient\Factories\HttpClientFactory;
use Quantum\HttpClient\HttpClient;
/**
* Creates single HTTP request client
*/
function httpRequest(string $url): HttpClient
{
return HttpClientFactory::createRequest($url);
}
/**
* Creates multi HTTP request client
*/
function httpMultiRequest(): HttpClient
{
return HttpClientFactory::createMultiRequest();
}
/**
* Creates async multi HTTP request client
*/
function httpAsyncMultiRequest(callable $success, callable $error): HttpClient
{
return HttpClientFactory::createAsyncMultiRequest($success, $error);
}