I have a very simple view that receives an ajax request containing a javascript object. The jquery request looks like this:
$.get(URL, {'kwargs': {test: 1}}, function(data){//whatever})
The problem is, request.GET now contains a rather strange key and looks like this:
{'kwargs[test]': [1]}
How can I successfully decode this? As a side note, it is impossible to know the key (test) beforehand
The expected format obtained is a python dict that looks like the one in the request.
I've tried:
request.GET.get('kwargs', None)
And I'd expect this as a result:
{'test': 1}
However, I get None, as the real key is 'kwargs[test]'
EDIT
I know I could use some kind of regex to accomplish this, but it feels as 'reinventing the wheel', as this use case is not that rare