I'm trying to write a simple script which should check **GCM** registration\_ids
in other word a try to recreate **cURL** request 

```
curl -i -X POST \
   -H "Authorization:key=auth_key" \
   -H "Content-Type:application/json" \
   -d '{"registration_ids": ["reg_key"], "data": {"test": "test"}}' \
 'https://android.googleapis.com/gcm/send'

```

in *pure* python

this is my code 

```
conn = httplib.HTTPSConnection("android.googleapis.com")
conn.connect()
conn.set_debuglevel(1)

body = {}
body['data'] =  {'test': 'test', 'dry-run' : True}
body['registration_ids'] = [key]
print "Send data \n" + str(body)
conn.putrequest('POST', '/gcm/send', str(body))
conn.putheader('Authorization', 'key='+auth_key)
conn.putheader('Content-Type','application/json')
conn.putheader('Content-Length', "%d" % len(str(body)))
conn.endheaders()
response = conn.getresponse()

```

for some reason even though my cURL work fine, when I use python I get response from server like these 

```
send: 'POST /gcm/send HTTP/1.1\r\nAccept-Encoding: identity\r\nAuthorization: key=auth_key\r\nContent-Type: application/json\r\nContent-Length: 252\r\n\r\n'
reply: 'HTTP/1.1 404 Not Found\r\n'
header: Content-Type: text/html; charset=UTF-8
header: Content-Length: 1433
header: Date: Thu, 12 Feb 2015 17:07:54 GMT
header: Server: GFE/2.0
header: Connection: close

```

so please help me to figure out what i'm doing wrong, thanks in advance.

**PS** if i'm omit Content-Length header in python script, i'll get 411 Content Length required, despite of cURL does not contain this header. Another mystery for me.