Skip to content

Commit 2e630ed

Browse files
committed
minor #18146 [HttpClient] Add ServerSentEvent::getArrayData() to get the SSE's data decoded as an array directly (alexandre-daubois)
This PR was merged into the 6.3 branch. Discussion ---------- [HttpClient] Add `ServerSentEvent::getArrayData()` to get the SSE's data decoded as an array directly Fixes #18142 Commits ------- 566aa26 [HttpClient] Add `ServerSentEvent::getArrayData()` to get the SSE's data decoded as an array directly
2 parents b29832e + 566aa26 commit 2e630ed

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)