mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #30997 -- Removed HttpRequest.is_ajax() usage.
This commit is contained in:
parent
5d654e1e71
commit
7fa0fa45c5
7 changed files with 47 additions and 30 deletions
|
@ -159,11 +159,11 @@ Use the ``django.test.Client`` class to make requests.
|
|||
|
||||
>>> c = Client()
|
||||
>>> c.get('/customers/details/', {'name': 'fred', 'age': 7},
|
||||
... HTTP_X_REQUESTED_WITH='XMLHttpRequest')
|
||||
... HTTP_ACCEPT='application/json')
|
||||
|
||||
...will send the HTTP header ``HTTP_X_REQUESTED_WITH`` to the
|
||||
details view, which is a good way to test code paths that use the
|
||||
:meth:`django.http.HttpRequest.is_ajax()` method.
|
||||
...will send the HTTP header ``HTTP_ACCEPT`` to the details view, which
|
||||
is a good way to test code paths that use the
|
||||
:meth:`django.http.HttpRequest.accepts()` method.
|
||||
|
||||
.. admonition:: CGI specification
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue