@@ -790,8 +790,9 @@ SSRF (Server-side request forgery) Handling
790790requests to an arbitrary domain. These attacks can also target the internal
791791hosts and IPs of the attacked server.
792792
793- If you use an ``HttpClient `` together with user-provided URIs, it is probably a
794- good idea to decorate it with a ``NoPrivateNetworkHttpClient ``. This will
793+ If you use an :class: `Symfony\\ Component\\ HttpClient\\ HttpClient ` together
794+ with user-provided URIs, it is probably a good idea to decorate it with a
795+ :class: `Symfony\\ Component\\ HttpClient\\ NoPrivateNetworkHttpClient `. This will
795796ensure local networks are made inaccessible to the HTTP client::
796797
797798 use Symfony\Component\HttpClient\HttpClient;
@@ -871,8 +872,8 @@ Configuring CurlHttpClient Options
871872
872873PHP allows to configure lots of `cURL options `_ via the :phpfunction: `curl_setopt `
873874function. In order to make the component more portable when not using cURL, the
874- `` CurlHttpClient `` only uses some of those options (and they are ignored in the
875- rest of clients).
875+ :class: ` Symfony \\ Component \\ HttpClient \\ CurlHttpClient ` only uses some of those
876+ options (and they are ignored in the rest of clients).
876877
877878Add an ``extra.curl `` option in your configuration to pass those extra options::
878879
@@ -1059,7 +1060,8 @@ Canceling Responses
10591060
10601061To abort a request (e.g. because it didn't complete in due time, or you want to
10611062fetch only the first bytes of the response, etc.), you can either use the
1062- ``cancel() `` method of ``ResponseInterface ``::
1063+ ``cancel() `` method of
1064+ :class: `Symfony\\ Contracts\\ HttpClient\\ ResponseInterface `::
10631065
10641066 $response->cancel();
10651067
@@ -1073,7 +1075,8 @@ Or throw an exception from a progress callback::
10731075 },
10741076 ]);
10751077
1076- The exception will be wrapped in an instance of ``TransportExceptionInterface ``
1078+ The exception will be wrapped in an instance of
1079+ :class: `Symfony\\ Contracts\\ HttpClient\\ Exception\\ TransportExceptionInterface `
10771080and will abort the request.
10781081
10791082In case the response was canceled using ``$response->cancel() ``,
@@ -1273,7 +1276,8 @@ that network errors can happen when calling e.g. ``getStatusCode()`` too::
12731276 Because ``$response->getInfo() `` is non-blocking, it shouldn't throw by design.
12741277
12751278When multiplexing responses, you can deal with errors for individual streams by
1276- catching ``TransportExceptionInterface `` in the foreach loop::
1279+ catching :class: `Symfony\\ Contracts\\ HttpClient\\ Exception\\ TransportExceptionInterface `
1280+ in the foreach loop::
12771281
12781282 foreach ($client->stream($responses) as $response => $chunk) {
12791283 try {
@@ -1417,9 +1421,9 @@ PSR-18 and PSR-17
14171421
14181422This component implements the `PSR-18 `_ (HTTP Client) specifications via the
14191423:class: `Symfony\\ Component\\ HttpClient\\ Psr18Client ` class, which is an adapter
1420- to turn a Symfony `` HttpClientInterface `` into a PSR-18 `` ClientInterface ``.
1421- This class also implements the relevant methods of ` PSR-17 `_ to ease creating
1422- request objects.
1424+ to turn a Symfony :class: ` Symfony \\ Contracts \\ HttpClient \\ HttpClientInterface `
1425+ into a PSR-18 `` ClientInterface ``. This class also implements the relevant
1426+ methods of ` PSR-17 `_ to ease creating request objects.
14231427
14241428To use it, you need the ``psr/http-client `` package and a `PSR-17 `_ implementation:
14251429
@@ -1480,9 +1484,9 @@ The `HTTPlug`_ v1 specification was published before PSR-18 and is superseded by
14801484it. As such, you should not use it in newly written code. The component is still
14811485interoperable with libraries that require it thanks to the
14821486:class: `Symfony\\ Component\\ HttpClient\\ HttplugClient ` class. Similarly to
1483- `` Psr18Client `` implementing relevant parts of PSR-17, `` HttplugClient `` also
1484- implements the factory methods defined in the related `` php-http/message-factory ``
1485- package.
1487+ :class: ` Symfony \\ Component \\ HttpClient \\ Psr18Client ` implementing relevant parts of PSR-17,
1488+ `` HttplugClient `` also implements the factory methods defined in the related
1489+ `` php-http/message-factory `` package.
14861490
14871491.. code-block :: terminal
14881492
@@ -1629,10 +1633,6 @@ The solution is to also decorate the response object itself.
16291633:class: `Symfony\\ Component\\ HttpClient\\ Response\\ TraceableResponse ` are good
16301634examples as a starting point.
16311635
1632- .. versionadded :: 5.2
1633-
1634- ``AsyncDecoratorTrait `` was introduced in Symfony 5.2.
1635-
16361636In order to help writing more advanced response processors, the component provides
16371637an :class: `Symfony\\ Component\\ HttpClient\\ AsyncDecoratorTrait `. This trait allows
16381638processing the stream of chunks as they come back from the network::
@@ -1690,15 +1690,20 @@ has many safety checks that will throw a ``LogicException`` if the chunk
16901690passthru doesn't behave correctly; e.g. if a chunk is yielded after an ``isLast() ``
16911691one, or if a content chunk is yielded before an ``isFirst() `` one, etc.
16921692
1693+ .. versionadded :: 5.2
1694+
1695+ :class: `Symfony\\ Component\\ HttpClient\\ AsyncDecoratorTrait ` was introduced in Symfony 5.2.
1696+
16931697Testing
16941698-------
16951699
1696- This component includes the ``MockHttpClient `` and ``MockResponse `` classes to
1697- use in tests that shouldn't make actual HTTP requests. Such tests can be
1698- useful, as they will run faster and produce consistent results, since they're
1699- not dependent on an external service. By not making actual HTTP requests there
1700- is no need to worry about the service being online or the request changing
1701- state, for example deleting a resource.
1700+ This component includes the :class: `Symfony\\ Component\\ HttpClient\\ MockHttpClient `
1701+ and :class: `Symfony\\ Component\\ HttpClient\\ Response\\ MockResponse ` classes to use
1702+ in tests that shouldn't make actual HTTP requests. Such tests can be useful, as they
1703+ will run faster and produce consistent results, since they're not dependent on an
1704+ external service. By not making actual HTTP requests there is no need to worry about
1705+ the service being online or the request changing state, for example deleting
1706+ a resource.
17021707
17031708``MockHttpClient `` implements the ``HttpClientInterface ``, just like any actual
17041709HTTP client in this component. When you type-hint with ``HttpClientInterface ``
0 commit comments