Answers for "how to process http post request over http in socket in python"

0

post request socket python

from socket import socket,error
headers = """GET http://www.google.com HTTP/1.1
                Host: www.google.comrnrn"""
try:
  s = socket()
  s.connect((host,int(port)))
  s.settimeout(4)
  s.send(headers.encode())
  s.recv(800)
  s.close()
except error:
  s.close()
Posted by: Guest on March-11-2021

Code answers related to "how to process http post request over http in socket in python"

Python Answers by Framework

Browse Popular Code Answers by Language