开发者

Python: how to make HTTP request internally/localhost

I want to send some paramete开发者_如何学JAVArs from a python script on my server to a php script on my server using HTTP. Suggestions?


This is pretty easy using urllib:

import urllib

myurl = 'http://localhost/script.php?var1=foo&var2=bar'

# GET is the default action
response = urllib.urlopen(myurl)  

# Output from the GET assuming response code was 200
data = response.read()            
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜