Doesn’t work:
ids=request.GET['ids[]']
Does work:
ids=request.GET.getlist('ids[]')
A typical Facebook friend invite sends the ids to be invited to your site as an array in 'ids[]'. Normally, you can pull values out with just request.GET['key']. But since the value of this particular key is an array and not just a string, you can’t (at least I wasn’t able to) just do ids=request.GET['ids[]']. That returns the first value of the array as a string. Not very helpful.
But, this is a QueryDict object, not a standard {} dict. As such, Django provides the getlist(key) method.
Django | Request and response objects | Django Documentation
getlist(key) — Returns the data with the requested key, as a Python
list. Returns an empty list if the key doesn’t exist. It’s guaranteed to
return a list of some sort.
