Reputation: 503
I want to send some parameters from a python script on my server to a php script on my server using HTTP. Suggestions?
Upvotes: 1
Views: 8647
Reputation: 33726
This is pretty easy using urllib:
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()
Upvotes: 2