1
I am developing an API in my work, and I need to develop something in python2 that sends a form to the server through the POST, I saw some questions here on the forum and I could not find anything that worked ... I need the community to help me!
Well, I’m using this code to understand the logic and pass it on to the senior project programmer:
import json
import urllib2
data = {
'id' : 1, 'number': 556291406183, 'message' : 'Hello'
}
req = urllib2.Request('http://lsweb.net.br/gabriel.php')
req.add_header('Content-Type', 'application/json')
response = urllib2.urlopen(req, json.dumps(data))
But I’m not getting results with this code, so it doesn’t send anything to the server. The intention was to send to the server page in POST and POST to read in PHP. HELP ME
Buddy, this is Sopt please translate your question! I see that you already have a while you are registered in the community, so I recommend you to do the Tour.
– NoobSaibot