Skip to content

Commit 8e238ae

Browse files
committed
🎉 added fetch.php
0 parents  commit 8e238ae

File tree

6 files changed

+565
-0
lines changed

6 files changed

+565
-0
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
open_collective: leaf

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
test
2+
Experimental
3+
vendor
4+
composer.lock

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Michael Darko-Duodu
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!-- markdownlint-disable no-inline-html -->
2+
<p align="center">
3+
<br><br>
4+
<img src="https://leaf-docs.netlify.app/images/logo.png" height="100"/>
5+
<h1 align="center">Leaf HTTP Fetch</h1>
6+
<br><br>
7+
</p>
8+
9+
# Leaf Fetch
10+
11+
<!-- [![Latest Stable Version](https://poser.pugx.org/leafs/leaf/v/stable)](https://packagist.org/packages/leafs/leaf)
12+
[![Total Downloads](https://poser.pugx.org/leafs/leaf/downloads)](https://packagist.org/packages/leafs/leaf)
13+
[![License](https://poser.pugx.org/leafs/leaf/license)](https://packagist.org/packages/leafs/leaf) -->
14+
15+
Clean, simple, developer friendly interface for making network requests with PHP. Fetch is based on curl and uses elements from Unirest PHP and an API that closely resembles Axios. ALl of these combined makes Fetch the best and simplest way to make PHP network requests.
16+
17+
## fetch example
18+
19+
```php
20+
use function Leaf\fetch;
21+
22+
$res = fetch([
23+
"method" => "GET",
24+
"url" => 'https://jsonplaceholder.typicode.com/todos/1',
25+
]);
26+
27+
echo json_encode($res->data);
28+
```
29+
30+
You can also use the fetch class
31+
32+
```php
33+
use Leaf\Fetch;
34+
35+
$res = Fetch::request([
36+
"method" => "GET",
37+
"url" => 'https://jsonplaceholder.typicode.com/todos/1',
38+
]);
39+
40+
echo json_encode($res->data);
41+
```
42+
43+
## View Leaf's docs [here](https://leafphp.netlify.app/#/)
44+
45+
Built with ❤ by [**Mychi Darko**](https://mychi.netlify.app)

composer.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "leafs/fetch",
3+
"description": "Plain simple PHP http client",
4+
"keywords": [
5+
"xhr",
6+
"fetch",
7+
"http",
8+
"leaf",
9+
"php",
10+
"network",
11+
"client"
12+
],
13+
"homepage": "https://github.com/leafsphp/redis",
14+
"type": "library",
15+
"license": "MIT",
16+
"authors": [
17+
{
18+
"name": "Michael Darko",
19+
"email": "[email protected]",
20+
"homepage": "https://mychi.netlify.app",
21+
"role": "Developer"
22+
}
23+
],
24+
"autoload": {
25+
"psr-4": {
26+
"Leaf\\": "src"
27+
}
28+
},
29+
"minimum-stability": "stable",
30+
"require": {
31+
"ext-curl": "*"
32+
}
33+
}

0 commit comments

Comments
 (0)