Django 1.8.x Documentation>>> c.get('/customers/details/', {'name': 'fred', 'age': 7}, ... HTTP_X_REQUESTED_WITH='XMLHttpRequest') …will send the HTTP header HTTP_X_REQUESTED_WITH to the details view, which is a good way as POST data with every POST request. For this reason, there is an alternative method: on each XMLHttpRequest, set a custom X-CSRFToken header to the value of the CSRF token. This is often easier, because made via an XMLHttpRequest, by checking the HTTP_X_REQUESTED_WITH header for the string 'XMLHttpRequest'. Most modern JavaScript libraries send this header. If you write your own XMLHttpRequest call (on the0 码力 | 2454 页 | 2.85 MB | 1 年前3
Django 1.11.x Documentation>>> c.get('/customers/details/', {'name': 'fred', 'age': 7}, ... HTTP_X_REQUESTED_WITH='XMLHttpRequest') …will send the HTTP header HTTP_X_REQUESTED_WITH to the details view, which is a good way as POST data with every POST request. For this reason, there is an alternative method: on each XMLHttpRequest, set a custom X-CSRFToken header to the value of the CSRF token. This is often easier, because made via an XMLHttpRequest, by checking the HTTP_X_REQUESTED_WITH header for the string 'XMLHttpRequest'. Most modern JavaScript libraries send this header. If you write your own XMLHttpRequest call (on the0 码力 | 2747 页 | 2.67 MB | 1 年前3
Django 1.10.x Documentation>>> c.get('/customers/details/', {'name': 'fred', 'age': 7}, ... HTTP_X_REQUESTED_WITH='XMLHttpRequest') ...will send the HTTP header HTTP_X_REQUESTED_WITH to the details view, which is a good way as POST data with every POST request. For this reason, there is an alternative method: on each XMLHttpRequest, set a custom X-CSRFToken header to the value of the CSRF token. This is often easier, because made via an XMLHttpRequest, by checking the HTTP_X_REQUESTED_WITH header for the string 'XMLHttpRequest'. Most modern JavaScript libraries send this header. If you write your own XMLHttpRequest call (on the0 码力 | 2538 页 | 2.59 MB | 1 年前3
Django 2.1.x Documentation>>> c.get('/customers/details/', {'name': 'fred', 'age': 7}, ... HTTP_X_REQUESTED_WITH='XMLHttpRequest') …will send the HTTP header HTTP_X_REQUESTED_WITH to the details view, which is a good way as POST data with every POST request. For this reason, there is an alternative method: on each XMLHttpRequest, set a custom X-CSRFToken header (as specified by the CSRF_HEADER_NAME setting) to the value made via an XMLHttpRequest, by checking the HTTP_X_REQUESTED_WITH header for the string 'XMLHttpRequest'. Most modern JavaScript libraries send this header. If you write your own XMLHttpRequest call (on the0 码力 | 2790 页 | 2.71 MB | 1 年前3
Django 2.2.x Documentation>>> c.get('/customers/details/', {'name': 'fred', 'age': 7}, ... HTTP_X_REQUESTED_WITH='XMLHttpRequest') …will send the HTTP header HTTP_X_REQUESTED_WITH to the details view, which is a good way as POST data with every POST request. For this reason, there is an alternative method: on each XMLHttpRequest, set a custom X-CSRFToken header (as specified by the CSRF_HEADER_NAME setting) to the value made via an XMLHttpRequest, by checking the HTTP_X_REQUESTED_WITH header for the string 'XMLHttpRequest'. Most modern JavaScript libraries send this header. If you write your own XMLHttpRequest call (on the0 码力 | 2915 页 | 2.83 MB | 1 年前3
Django 2.0.x Documentation>>> c.get('/customers/details/', {'name': 'fred', 'age': 7}, ... HTTP_X_REQUESTED_WITH='XMLHttpRequest') …will send the HTTP header HTTP_X_REQUESTED_WITH to the details view, which is a good way as POST data with every POST request. For this reason, there is an alternative method: on each XMLHttpRequest, set a custom X-CSRFToken header to the value of the CSRF token. This is often easier, because made via an XMLHttpRequest, by checking the HTTP_X_REQUESTED_WITH header for the string 'XMLHttpRequest'. Most modern JavaScript libraries send this header. If you write your own XMLHttpRequest call (on the0 码力 | 2746 页 | 2.67 MB | 1 年前3
Django 3.2.x Documentationdistinction for the fallback is based on whether the X- Requested-With header is set to the value XMLHttpRequest. This is set by the jQuery ajax() method. Here’s example HTML template code: {% load i18n %} as POST data with every POST request. For this reason, there is an alternative method: on each XMLHttpRequest, set a custom X-CSRFToken header (as specified by the CSRF_HEADER_NAME setting) to the value made via an XMLHttpRequest, by checking the HTTP_X_REQUESTED_WITH header for the string 'XMLHttpRequest'. Most modern JavaScript libraries send this header. If you write your own XMLHttpRequest call (on the0 码力 | 3121 页 | 3.08 MB | 1 年前3
Django 3.1.x Documentationdistinction for the fallback is based on whether the X- Requested-With header is set to the value XMLHttpRequest. This is set by the jQuery ajax() method. Here’s example HTML template code: {% load i18n %} as POST data with every POST request. For this reason, there is an alternative method: on each XMLHttpRequest, set a custom X-CSRFToken header (as specified by the CSRF_HEADER_NAME setting) to the value made via an XMLHttpRequest, by checking the HTTP_X_REQUESTED_WITH header for the string 'XMLHttpRequest'. Most modern JavaScript libraries send this header. If you write your own XMLHttpRequest call (on the0 码力 | 3094 页 | 3.03 MB | 1 年前3
Django 3.0.x Documentation>>> c.get('/customers/details/', {'name': 'fred', 'age': 7}, ... HTTP_X_REQUESTED_WITH='XMLHttpRequest') …will send the HTTP header HTTP_X_REQUESTED_WITH to the details view, which is a good way as POST data with every POST request. For this reason, there is an alternative method: on each XMLHttpRequest, set a custom X-CSRFToken header (as specified by the CSRF_HEADER_NAME setting) to the value made via an XMLHttpRequest, by checking the HTTP_X_REQUESTED_WITH header for the string 'XMLHttpRequest'. Most modern JavaScript libraries send this header. If you write your own XMLHttpRequest call (on the0 码力 | 3085 页 | 2.95 MB | 1 年前3
Django 1.8.x DocumentationClient() >>> c.get('/customers/details/', {'name': 'fred', 'age': 7}, ... HTTP_X_REQUESTED_WITH='XMLHttpRequest') . . .will send the HTTP header HTTP_X_REQUESTED_WITH to the details view, which is a good 914 Chapter 6. API Reference Django Documentation, Release 1.8.20.dev20180306181007 on each XMLHttpRequest, set a custom X-CSRFToken header to the value of the CSRF token. This is often easier, because made via an XMLHttpRequest, by checking the HTTP_X_REQUESTED_WITH header for the string 'XMLHttpRequest'. Most modern JavaScript libraries send this header. If you write your own XMLHttpRequest call (on the0 码力 | 1685 页 | 6.01 MB | 1 年前3
共 30 条
- 1
- 2
- 3













