Search
 
SCRIPT & CODE EXAMPLE
 

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

PREVIOUS NEXT
Code Example
Python :: can you look for specific characters in python 
Python :: concatenate list of strings python 
Python :: python sys.argv 
Python :: heatmap in python 
Python :: python isinstance 
Python :: hashing in python using chaining in python 
Python :: pandas dataframe get first n rows 
Python :: Code of recursive binary search 
Python :: oserror: invalid cross-device link 
Python :: python turtle set screen size 
Python :: Python "for in" loop to print the last item in the list 
Python :: delete row if contains certain text pandas 
Python :: modulo python 
Python :: how to download packages using pip 
Python :: flask flash 
Python :: python dictionary multiple same keys 
Python :: scroll to element selenium python 
Python :: how to find lcm of 2 numbers in python 
Python :: list of dicts 
Python :: continue statement python 
Python :: dict to attr python 
Python :: pandas find all rows not null 
Python :: Django how to get url path for a view 
Python :: how to import and use keyboard with pygame 
Python :: python object of type set is not json serializable 
Python :: dataframe fill nan with mode 
Python :: sum along axis python 
Python :: Setting spacing between ticks in matplotlib 
Python :: how to input n space separated integers in python 
Python :: python check if array 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =