Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #91967

Re: python 3.4 use python-gcm can't import

Newsgroups comp.lang.python
Date 2015-06-03 07:33 -0700
References <c6179d50-e8c4-43d4-896f-77d234e0f9ff@googlegroups.com> <mailman.13596.1409285341.18130.python-list@python.org> <9c330850-fd0d-4190-a924-5cd99fbaccd6@googlegroups.com>
Message-ID <48616a02-4d2a-4ef4-8f10-c69e671e71a3@googlegroups.com> (permalink)
Subject Re: python 3.4 use python-gcm can't import
From dav.kuhn@gmail.com

Show all headers | View raw


Le vendredi 29 août 2014 10:35:29 UTC+2, Frank Liou a écrit :

> and body is "b'" .....is empty
> 
> i'm so confused.don't know it work or not

Hi, you should read() before you close() the connection.

conn = http.client.HTTPConnection('android.googleapis.com')
conn.request('POST', '/gcm/send', jqs, headers)
res = conn.getresponse()
body = res.read()
conn.close()
print(body)
David

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: python 3.4 use python-gcm can't import dav.kuhn@gmail.com - 2015-06-03 07:33 -0700

csiph-web