t = 'POST / HTTP/1.0
Authentication: Bot {token}
Host: discord.com/api/guilds/{702627382091186318}/channels
'
This is not a valid HTTP request. You essentially send (line breaks added for clarity):
POST / HTTP/1.0
Authentication: Bot {token}
Host: discord.com/api/guilds/{702627382091186318}/channels
But a correct POST request would look like this instead:
POST /api/guilds/{702627382091186318}/channels HTTP/1.0
Authentication: Bot {token}
Host: discord.com
Content-length: ...
<body, where size matches Content-length header>
I.e. you have the wrong path, wrong Host
header, missing body and missing Content-length
header. If you really want to write your own HTTP stack instead of using existing libraries please study the standards instead of just guessing how it might look - that what standards are for.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…