[Nginx] perl module get an empty body

darkweaver871 nginx-forum at nginx.us
Fri Aug 10 11:03:27 UTC 2012

It can be reproduced by commenting/uncommenting the append in the
following code:

# -*- coding: utf-8 -*-

import urllib
import urllib2

url = 'https://www.test.com/test.php'
params = { 'name': 'Luke', 'location': 'Tatooine' }
pList = []
for paramKey, paramValue in params.items():
    pList.append(urllib.quote_plus(unicode('%s=%s' % (paramKey,
    #pList.append('%s=%s' % (paramKey,

post_params = '&'.join(pList)
req = urllib2.Request(url, data=post_params)
f = urllib2.urlopen(req)

print f.read()

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,229560,229566#msg-229566

More information about the nginx mailing list