Skip to content

[HttpClient] Add ServerSentEvent::getArrayData() to get the SSE's data decoded as an array directly #18146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions http_client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,16 @@ to wrap your HTTP client, open a connection to a server that responds with a
}
}

.. tip::

If you know that the content of the ``ServerSentEvent`` is in the JSON format, you can
use the :method:`Symfony\\Component\\HttpClient\\Chunk\\ServerSentEvent::getArrayData`
method to directly get the decoded JSON in an array.

.. versionadded:: 6.3

The ``ServerSentEvent::getArrayData()`` method was introduced in Symfony 6.3.

Interoperability
----------------

Expand Down