I'm trying to send a post request to https://trades.roblox.com/v1/trades/send using proxies. These proxies use user:pass authorization. However, I get a 503 bad gateway error when sending the post request.
Here is my code:
import base64
proxies = [] #where my proxies are, they are inserted as IP:port.
username = 'myusername'
password = 'mypassword'
cred = '{}:{}'.format(username, password)
cred = base64.b64encode(cred.encode('utf-8')).decode('utf-8')
conn = http.client.HTTPConnection(random.choice(proxies))
conn.set_tunnel(
"https://trades.roblox.com", port = 443, headers = {'Proxy-Authorization': 'Basic
{}'.format(cred)}
)
conn.request(
"POST",
"/v1/trades/send",
data,
{'content-type': 'application/json'}
)
print(conn.getresponse())
If anyone knows why this error occurs that would help me a lot, thanks.