Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Estava em inglês
Fonte Link
Gabriel
  • 27
  • 1
  • 5

Submit Enviar formulário POST form withcom python

I'm developing anEstou desenvolvendo uma API in my workno meu trabalho, and I need to develop something ine preciso desenvolver algo no python2 that sends a form to the server throughque envia um formulário para o servidor através do POST, I saw some questions here in the forum and I could not find anything that workedvi algumas perguntas aqui no fórum e não consegui encontrar nada que funcionasse ... I need the community to helpPreciso do comunidade para me ajudar!

WellBem, I'm using this code to understand the logic and move to the senior programmer of the projecteu estou usando esse código para entender a lógica e passar para o programador sênior do projeto:

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 codeMas não estou obtendo resultados com este código, so it does not send anything to the serverpor isso não envia nada ao servidor. The intention was to send to such page of the server inA intenção era enviar para a página do servidor em POST ande POST to be read inpara ler em PHP. HELPAJUDE-ME

Submit POST form with python

I'm developing an API in my work, and I need to develop something in python2 that sends a form to the server through POST, I saw some questions here in 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 move to the senior programmer of the project:

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 does not send anything to the server. The intention was to send to such page of the server in POST and POST to be read in PHP. HELP-ME

Enviar formulário POST com python

Estou desenvolvendo uma API no meu trabalho, e preciso desenvolver algo no python2 que envia um formulário para o servidor através do POST, vi algumas perguntas aqui no fórum e não consegui encontrar nada que funcionasse ... Preciso do comunidade para me ajudar!

Bem, eu estou usando esse código para entender a lógica e passar para o programador sênior do projeto:

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))

Mas não estou obtendo resultados com este código, por isso não envia nada ao servidor. A intenção era enviar para a página do servidor em POST e POST para ler em PHP. AJUDE-ME

Fonte Link
Gabriel
  • 27
  • 1
  • 5

Submit POST form with python

I'm developing an API in my work, and I need to develop something in python2 that sends a form to the server through POST, I saw some questions here in 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 move to the senior programmer of the project:

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 does not send anything to the server. The intention was to send to such page of the server in POST and POST to be read in PHP. HELP-ME