Question: I'd like to send request using python and requests library. 
I have checked this request in web browser inspector and form data looks like that:

```
data[foo]: bar
data[numbers][]: 1
data[numbers][]: 2
data[numbers][]: 3
data[numbers][]: 4
data[numbers][]: 5
csrf_hash: 12345

```

This is my code:

```
payload = {'data[foo]': 'bar', 'csrf_hash': 12345,
         'data[numbers]': [1, 2, 3, 4, 5]}
r = s.post('https://www.foo.com/bar/', payload)

```

It doesn't work. I'm getting error because of invalid post data

Answer: 
I resolve problem with this code:

```
payload = {'data[foo]': 'bar', 'csrf_hash': 12345,
     'data[numbers][0]': 1, 'data[numbers][1]': 2, 'data[numbers][2]': 3, 'data[numbers][3]': 4, 'data[numbers][4]': 5}
r = s.post('https://www.foo.com/bar/', payload)

```

It's not very beautiful, but works.
Can you try to do this:

```
import json

url = 'https://www.foo.com/bar/'
payload = {'some': 'data'}

r = requests.post(url, data=json.dumps(payload))

```