farbodg
farbodg

Reputation: 705

List of items lost when using QueryDict

I'm sending the following JSON to my webservice:

{
"message": "Hello!",
"people": ["Aaron", "Randy", "Chris", "Andrew"]
}

And when I access the QueryDict, dict['people'] returns the last item in the list, Andrew, not the list. What am I doing wrong?

When inspecting the object: enter image description here

Upvotes: 0

Views: 197

Answers (1)

catavaran
catavaran

Reputation: 45595

Use the getlist() method:

people = request.GET.getlist('people')

Upvotes: 2

Related Questions