import requests unit_ip = '192.168.0.172' hex_data = '\x00\x01\x02' # Flex firmware 21 or earlier url = 'http://' + unit_ip + '/api/host/modules/1/ports/1/data' # Global Connect or Flex firmware 22 or later #url = 'http://' + unit_ip + '/api/host/modules/1/serial/ports/1/data' #Execute request requests.post(url,data=hex_data,headers={'Content-Type': 'text/plain; charset=UTF-8'})