Skip to content

Commit 566aa26

Browse files
[HttpClient] Add ServerSentEvent::getArrayData() to get the SSE's data decoded as an array directly
1 parent b29832e commit 566aa26

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

http_client.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,16 @@ to wrap your HTTP client, open a connection to a server that responds with a
14251425
}
14261426
}
14271427

1428+
.. tip::
1429+
1430+
If you know that the content of the ``ServerSentEvent`` is in the JSON format, you can
1431+
use the :method:`Symfony\\Component\\HttpClient\\Chunk\\ServerSentEvent::getArrayData`
1432+
method to directly get the decoded JSON in an array.
1433+
1434+
.. versionadded:: 6.3
1435+
1436+
The ``ServerSentEvent::getArrayData()`` method was introduced in Symfony 6.3.
1437+
14281438
Interoperability
14291439
----------------
14301440

0 commit comments

Comments
 (0)