Four ways to get Django parameters in request

1. Query string data (String)
Like:?key1=value1& Key2 = value2
use

requisition.get ("key", "value") GET
2. request-getlist ("key", []) GET the last value

Ii. Request Body Data (BODY) :
For example: form data, JSON,…
2.1 form data :(only post requests are supported)

request.POST.get("name", "")

2.1 json data :(post and put requests are supported)

Loads (json_str) json_str = request. Body # attribute to get the original request data
json_dict = json.json (json_str)# convert the original data into dictionary format
json_dict. Get ("key", "default value ") # get the data

3. Specific part of data in the URL path

Regular, or routing converter

4. Request Header Data (HEADER) :

request.MEAT.get("key")

Read More: