Skip to content

Commit 4f0b491

Browse files
committed
📝 updated readme
1 parent f4f923e commit 4f0b491

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!-- markdownlint-disable no-inline-html -->
22
<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>
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>
77
</p>
88

99
# Leaf Fetch
@@ -12,7 +12,7 @@
1212
[![Total Downloads](https://poser.pugx.org/leafs/leaf/downloads)](https://packagist.org/packages/leafs/leaf)
1313
[![License](https://poser.pugx.org/leafs/leaf/license)](https://packagist.org/packages/leafs/leaf) -->
1414

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.
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.
1616

1717
## fetch example
1818

@@ -113,6 +113,22 @@ echo json_encode($res);
113113

114114
### shortcut methods
115115

116+
The fetch class comes with shortcut methods named after http methods `get`, `post`, `put`, `patch`, ...
117+
118+
```php
119+
$res = Fetch::post("/posts", [
120+
"title" => "foo",
121+
"body" => "bar",
122+
"userId" => 2,
123+
]);
124+
125+
$res = Fetch::get("/todos/10");
126+
127+
Fetch::delete("/todos/10");
128+
129+
// ...
130+
```
131+
116132
## View Leaf's docs [here](https://leafphp.netlify.app/#/)
117133

118134
Built with ❤ by [**Mychi Darko**](https://mychi.netlify.app)

0 commit comments

Comments
 (0)