Not able to pass domain_id when creating subnet through the Foreman API

I'm trying to create a subnet via the API using Python + requests, and I'd
like to specify which domain the subnet belongs to. According to the docs,
I need to specify "domain_ids" as a list:
http://theforeman.org/api/1.9/apidoc/v2/subnets.html#description-create

I attempted to do so as follows:
import requests

subnet = {}
subnet['name'] = "10.230.0.0"
subnet['network'] = "10.230.0.0"
subnet['mask'] = "255.255.255.252"
subnet['gateway'] = "10.230.0.1"
subnet['dns_primary'] = "10.1.1.1"
subnet['ipam'] = "DHCP"
subnet['boot_mode'] = "DHCP"
subnet['domain_ids'] = [10,11,12]

headers = {'Accept': "version=2,application/json", 'Content-Type':
'application/json'}
requests.post(url, headers=headers, auth=auth, verify=False, data=subnets)

This creates the subnet, but doesn't associate the subnet with the domain
ID's I've given. The response from the servers shows a blank "u'domains':
[]"

If I try from Hammer, and use the -d switch, it works. The parameters
there look like this:

Params: {
"subnet" => {
"gateway" => "10.230.0.1",
"domain_ids" => [
[0] "10",
[1] "11",
[2] "12"
],
"network" => "10.230.0.0",
"dns_primary" => "10.1.90.19",
"mask" => "255.255.255.252",
"ipam" => "DHCP",
"boot_mode" => "DHCP",
"name" => "10.230.0.0"
}
}

I've tried variations on subnet['domain_ids'] = [10,11,12], including
specifying the ID's as strings, and trying as a tuple, and as a dict with
numeric indexes as keys.

Does anyone know how the domain_id should be passed?