From 7b6a44cfbb2a60f651b97895bfe5616637b6888f Mon Sep 17 00:00:00 2001 From: Diogo Peralta Cordeiro Date: Tue, 3 Aug 2021 18:22:37 +0100 Subject: [PATCH] [DOCS][Dev] Add HTTP Client --- docs/developer/src/SUMMARY.md | 2 +- docs/developer/src/http.md | 0 docs/developer/src/httpclient.md | 11 +++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) delete mode 100644 docs/developer/src/http.md create mode 100644 docs/developer/src/httpclient.md diff --git a/docs/developer/src/SUMMARY.md b/docs/developer/src/SUMMARY.md index 6231f1d5fa..92d4c112cf 100644 --- a/docs/developer/src/SUMMARY.md +++ b/docs/developer/src/SUMMARY.md @@ -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) diff --git a/docs/developer/src/http.md b/docs/developer/src/http.md deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/docs/developer/src/httpclient.md b/docs/developer/src/httpclient.md new file mode 100644 index 0000000000..94233d5ef8 --- /dev/null +++ b/docs/developer/src/httpclient.md @@ -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). \ No newline at end of file