Implementation method when you want to process using query string in Django
python
qs = request.META['QUERY_STRING']
When the following query string is passed at the time of request, the above code ...
? __ search = true & access_dt_0 = & access_dt_1 = & access_user = 10000 & access_kb = & access_content =
The contents of qs are as follows.
<QueryDict: {'__search': ['true'], 'access_user': ['10000'], 'access_kb':
[''], 'access_dt_0': [''], 'access_dt_1': [''], 'access_content': ['Tesu
When']}>
In HttpRequest.META, HTTP headers are stored in the following dictionary, so it can be used in various other ways.
https://docs.djangoproject.com/en/1.10/ref/request-response/#django.http.HttpRequest.META
Recommended Posts