Hi there, I want to use request.raw_args to get the parameters of the GET request,
But I found that the attribute was gone
I want to implement this function myself, But Request Class can’t set attribute
What should I do to add attributes to Request or pass parameter to view by request ?
I know I can add attribute for request.app. But think that should be used to store global variables.
can you give me some suggestion?
Please tell me how you regard and deal with adding attributes to each different reuqest
Thank you !
this is my code, but it’s not useful
Blockquote
async def request_check_middleware(request):
if request.method == ‘GET’:
raw_args = {item: request.args.get(item)[0] for item in request.args}
slots = list(request.slots)
slots.append(‘raw_args’)
request.slots = tuple(slots)
request.raw_args = raw_args