You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*Fetch is still in its early stages and is being actively developed. If you have any issues or suggestions, please feel free to open an issue or a pull request.*
42
+
41
43
## Installation
42
44
43
45
You can quickly install leaf fetch with the Leaf CLI
@@ -52,240 +54,28 @@ Or with composer:
52
54
composer require leafs/fetch
53
55
```
54
56
55
-
## Options
56
-
57
-
This is the array which is used to construct the request to be sent. The available fields are:
58
-
59
-
```php
60
-
[
61
-
// `url` is the server URL that will be used for the request
62
-
"url" => null,
63
-
64
-
// `method` is the request method to be used when making the request
65
-
"method" => "GET", // default
66
-
67
-
// `baseURL` will be prepended to `url` unless `url` is absolute.
68
-
// It can be convenient to set `baseURL` for an instance of axios to pass relative URLs
69
-
// to methods of that instance.
70
-
"baseUrl" => "",
71
-
72
-
// `transformRequest` allows changes to the request data before it is sent to the server
73
-
// This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE'
74
-
// The last function in the array must return a string or an instance of Buffer, ArrayBuffer,
75
-
// FormData or Stream
76
-
// You may modify the headers object.
77
-
// "transformRequest" => function ($data, $headers) {
78
-
// // Do whatever you want to transform the data
79
-
80
-
// return $data;
81
-
// },
82
-
83
-
// `transformResponse` allows changes to the response data to be made before
84
-
// it is passed to then/catch
85
-
// "transformResponse" => function ($data) {
86
-
// // Do whatever you want to transform the data
87
-
88
-
// return $data;
89
-
// },
90
-
91
-
// `headers` are custom headers to be sent
92
-
"headers" => [],
93
-
94
-
// `params` are the URL parameters to be sent with the request
95
-
// Must be a plain object or a URLSearchParams object
96
-
"params" => [],
97
-
98
-
// `paramsSerializer` is an optional function in charge of serializing `params`
// `maxRedirects` defines the maximum number of redirects to follow in node.js.
175
-
// If set to 0, no redirects will be followed.
176
-
"maxRedirects" => 5, // default
177
-
178
-
// `socketPath` defines a UNIX Socket to be used in node.js.
179
-
// e.g. '/var/run/docker.sock' to send requests to the docker daemon.
180
-
// Only either `socketPath` or `proxy` can be specified.
181
-
// If both are specified, `socketPath` is used.
182
-
"socketPath" => null, // default
183
-
184
-
// `proxy` defines the hostname, port, and protocol of the proxy server.
185
-
// You can also define your proxy using the conventional `http_proxy` and
186
-
// `https_proxy` environment variables. If you are using environment variables
187
-
// for your proxy configuration, you can also define a `no_proxy` environment
188
-
// variable as a comma-separated list of domains that should not be proxied.
189
-
// Use `false` to disable proxies, ignoring environment variables.
190
-
// `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and
191
-
// supplies credentials.
192
-
// This will set an `Proxy-Authorization` header, overwriting any existing
193
-
// `Proxy-Authorization` custom headers you have set using `headers`.
194
-
// If the proxy server uses HTTPS, then you must set the protocol to `https`.
195
-
"proxy" => [],
196
-
197
-
// `decompress` indicates whether or not the response body should be decompressed
198
-
// automatically. If set to `true` will also remove the 'content-encoding' header
199
-
// from the responses objects of all decompressed responses
200
-
// - Node only (XHR cannot turn off decompression)
201
-
"decompress" => true, // default
202
-
203
-
// If false, fetch will try to parse json responses
204
-
"rawResponse" => false,
205
-
206
-
// CURLOPT_SSL_VERIFYHOST accepts only 0 (false) or 2 (true).
207
-
// Future versions of libcurl will treat values 1 and 2 as equals
208
-
"verifyHost" => true, // default
209
-
210
-
"verifyPeer" => true, // default
211
-
212
-
// Set additional options for curl.
213
-
"curl" => [],
214
-
];
215
-
```
216
-
217
-
## 💬 Stay In Touch
57
+
## Stay In Touch
218
58
219
59
-[Twitter](https://twitter.com/leafphp)
220
60
-[Join the forum](https://github.com/leafsphp/leaf/discussions/37)
221
61
-[Chat on discord](https://discord.com/invite/Pkrm9NJPE3)
222
62
223
-
## 📓 Learning Leaf 3
63
+
## Learning Leaf PHP
224
64
225
65
- Leaf has a very easy to understand [documentation](https://leafphp.dev) which contains information on all operations in Leaf.
226
66
- You can also check out our [youtube channel](https://www.youtube.com/channel/UCllE-GsYy10RkxBUK0HIffw) which has video tutorials on different topics
227
-
-We are also working on codelabs which will bring hands-on tutorials you can follow and contribute to.
67
+
-You can also learn from [codelabs](https://leafphp.dev/codelabs/)and contribute as well.
228
68
229
-
## 😇 Contributing
69
+
## Contributing
230
70
231
71
We are glad to have you. All contributions are welcome! To get started, familiarize yourself with our [contribution guide](https://leafphp.dev/community/contributing.html) and you'll be ready to make your first pull request 🚀.
232
72
233
73
To report a security vulnerability, you can reach out to [@mychidarko](https://twitter.com/mychidarko) or [@leafphp](https://twitter.com/leafphp) on twitter. We will coordinate the fix and eventually commit the solution in this project.
Your cash contributions go a long way to help us make Leaf even better for you. You can sponsor Leaf and any of our packages on [open collective](https://opencollective.com/leaf) or check the [contribution page](https://leafphp.dev/support/) for a list of ways to contribute.
254
-
255
-
And to all our existing cash/code contributors, we love you all ❤️
We are committed to keeping Leaf open-source and free, but maintaining and developing new features now requires significant time and resources. As the project has grown, so have the costs, which have been mostly covered by the team. To sustain and grow Leaf, we need your help to support full-time maintainers.
284
78
285
-
## 🤯 Links/Projects
79
+
You can sponsor Leaf and any of our packages on [open collective](https://opencollective.com/leaf) or check the [contribution page](https://leafphp.dev/support/) for a list of ways to contribute.
286
80
287
-
-[Aloe CLI](https://leafphp.dev/aloe-cli/)
288
-
-[Leaf Docs](https://leafphp.dev)
289
-
-[Leaf MVC](https://mvc.leafphp.dev)
290
-
-[Leaf API](https://api.leafphp.dev)
291
-
-[Leaf CLI](https://cli.leafphp.dev)
81
+
And to all our [existing cash/code contributors](https://leafphp.dev#sponsors), we love you all ❤️
0 commit comments