Skip to content

Commit 2fd054f

Browse files
Improved readme
1 parent 2e73bee commit 2fd054f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
PHP Fetch
2-
=========
3-
4-
A simple, type-safe, zero dependency port of the javascript `fetch` WebApi for PHP.
1+
<h1 align="center">PHP Fetch</h1>
52

3+
<p align="center">A simple, type-safe, zero dependency port of the javascript fetch WebApi for PHP.</p>
64

75
<h3 align="center">
86
<img style="alignment: center" src="https://media0.giphy.com/media/xlYKItjhiDsY/giphy.gif?cid=ecf05e474io66b5jt2mrufubg3otjzq26qgtqd0cb0w71fiu&rid=giphy.gif"/>
@@ -63,9 +61,12 @@ while (($chunk = $response->body()->read()) !== null) {
6361

6462
At the moment, the only options supported are:
6563

66-
- `method`: Sets the request method
67-
- `body`: The request body. It can be a `resource`, a `string` or `null`.
68-
- `headers`: An associative array of header names and values.
64+
- `method (string)`: Sets the request method
65+
- `body (resource|string)`: The request body.
66+
- `headers (array<string|string>)`: An associative array of header names and values.
67+
- `follow_redirects (bool)`: Whether to follow redirects or not. Default is `true`.
68+
- `protocol_version (string)`: The http protocol version to use. Default is `1.1`.
69+
- `max_redirects (int)`: The number of times you allow redirecting. Default is `20`.
6970

7071
### Getting response information
7172

@@ -85,7 +86,7 @@ echo $response->status()->reasonPhrase(); // OK
8586
echo $response->headers()->has('content-type'); // true
8687
echo $response->headers()->contains('content-type', 'html'); // true
8788
echo $response->headers()->get('content-type'); // text/html;charset=utf-8
88-
echo $response->body()->read(''); // Outputs some bytes from the response body
89+
echo $response->body()->read(); // Outputs some bytes from the response body
8990
```
9091

9192
### Exception Handling

0 commit comments

Comments
 (0)