forked from GNUsocial/gnu-social
[DOCS][Dev] Add HTTP Client
This commit is contained in:
parent
c99e447308
commit
7b6a44cfbb
@ -13,7 +13,7 @@
|
||||
- [Queue](./queue.md)
|
||||
- [Attachments, Files and Thumbnails](./attachments.md)
|
||||
- [Security](./security.md)
|
||||
- [HTTP](./http.md)
|
||||
- [HTTP Client](./httpclient.md)
|
||||
- [Plugins](./plugins.md)
|
||||
- [Configuration](./plugins/configuration.md)
|
||||
- [Initialization and Clean Up](./plugins/lifetime.md)
|
||||
|
11
docs/developer/src/httpclient.md
Normal file
11
docs/developer/src/httpclient.md
Normal file
@ -0,0 +1,11 @@
|
||||
# HTTP Client
|
||||
It is sometimes necessary to perform HTTP requests. We simply have a static wrapper
|
||||
around [Symfony HTTP](https://symfony.com/doc/current/http_client.html#basic-usage).
|
||||
|
||||
You can do `App\Core\HTTPClient::{METHOD}(string: $url, array: $options): ResponseInterface`.
|
||||
The `$options` are elaborated in [Symfony Doc](https://symfony.com/doc/current/http_client.html#configuring-curlhttpclient-options).
|
||||
|
||||
Please note that the HTTP Client is [lazy](https://en.wikipedia.org/wiki/Lazy_evaluation),
|
||||
which makes it very important to bear in mind [Network Errors](https://symfony.com/doc/current/http_client.html#dealing-with-network-errors),
|
||||
|
||||
What you can take from Responses is specified [here](https://symfony.com/doc/current/http_client.html#processing-responses).
|
Loading…
Reference in New Issue
Block a user