1import pycurl
2import StringIO
3
4response = StringIO.StringIO()
5c = pycurl.Curl()
6c.setopt(c.URL, 'https://www.googleapis.com/qpxExpress/v1/trips/search?key=mykeyhere')
7c.setopt(c.WRITEFUNCTION, response.write)
8c.setopt(c.HTTPHEADER, ['Content-Type: application/json','Accept-Charset: UTF-8'])
9c.setopt(c.POSTFIELDS, '@request.json')
10c.perform()
11c.close()
12print response.getvalue()
13response.close()
14