I'm making a script to open ports on my router / modem via getting the open port POST request and using it here but I get this error when sending: TypeError: a bytes-like object is required, not 'str'. It should just send the POST request and open the port not the error.
url = "http://192.168.0.1/apply_abstract.cgi" # http://192.168.0.1/wan_portforwarding.htm?m=adv
reqInfo = {
'action: ui_firewall',
'httoken: REMOVED FOR SAFETY',
'submit_button: wan_portforwarding.htm',
'786434001000: ' + GlobalForwardingName,
'786433001000: 1',
'786435001000: ' + GlobalInternalIP,
'#786437001000: ' + GlobalProtocol,
'786438001000: ', GlobalLanPort,
'786439001000: ', GlobalLanPort,
'786440001000: ', GlobalWanPort,
'786441001000: ', GlobalWanPort
}
sendReq = requests.post(url, data = reqInfo)```