Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

post request socket python

from socket import socket,error
headers = """GET http://www.google.com HTTP/1.1
                Host: www.google.com

"""
try:
  s = socket()
  s.connect((host,int(port)))
  s.settimeout(4)
  s.send(headers.encode())
  s.recv(800)
  s.close()
except error:
  s.close()
 
PREVIOUS NEXT
Tagged: #post #request #socket #python
ADD COMMENT
Topic
Name
1+8 =