我试图使用我的python脚本从php脚本获取数据:
#!/usr/bin/python
import urllib
import urllib2
url = 'https://example.com/example.php'
data = urllib.urlencode({'login' : 'mylogin', 'pwd' : 'mypass', 'data' : 'mydata'})
req = urllib2.Request(url, data)
response = urllib2.urlopen(req)
d = response.read()
print d
不会运行错误:
ERROR=1704
php脚本接受:
url: https://example.com/example.php?login=xxxxxxx&pwd=xxxxxxx&t=3