开发者

Python: how to make HTTP request internally/localhost

开发者 https://www.devze.com 2023-01-19 17:36 出处:网络
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:

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

精彩评论

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