PHP处理来自Python的Post的json数据
程序员文章站
2024-01-06 12:09:16
...
__author__ = 'jiezhi' import urllib import urllib2 data = {'name': 'jiezhi', 'age': '24'} ret = urllib2.urlopen(url='http://jiezhiblog.com/test.php', data=urllib.urlencode(data)) print ret.read()
__author__ = 'jiezhi' import urllib2 import json data = {'name': 'jiezhi', 'age': '24'} ret = urllib2.urlopen(url='http://jiezhiblog.com/test.php', data=json.dumps(data)) print ret.read()