Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 46dfc42

Browse files
committed
[#1868] Backporting details about getting Request Accept data to 2.0
1 parent 88f06c6 commit 46dfc42

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

components/http_foundation/introduction.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,21 @@ the
214214
method tells you if the request contains a Session which was started in one of
215215
the previous requests.
216216

217+
Accessing `Accept-*` Headers Data
218+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
219+
220+
You can easily access basic data extracted from ``Accept-*`` headers
221+
by using the following methods:
222+
223+
* :method:`Symfony\\Component\\HttpFoundation\\Request::getAcceptableContentTypes`:
224+
returns the list of accepted content types ordered by descending quality;
225+
226+
* :method:`Symfony\\Component\\HttpFoundation\\Request::getLanguages`:
227+
returns the list of accepted languages ordered by descending quality;
228+
229+
* :method:`Symfony\\Component\\HttpFoundation\\Request::getCharsets`:
230+
returns the list of accepted languages ordered by descending quality;
231+
217232
Accessing other Data
218233
~~~~~~~~~~~~~~~~~~~~
219234

0 commit comments

Comments
 (0)