I'm trying to get contents of a page using socket.
Here is my code:
alias test {
  sockopen test decapi.me 80

on *:sockopen:test: {
  sockwrite -n $sockname get /twitch/followage/forsen/sodapoppin HTTP/1.0 
  sockwrite -n $sockname Host: decapi.me
  sockwrite -n $sockname

on *:sockread:test: {
  if ($sockerr) {
    echo -a Error.
  else {
    var %temp
    sockread %temp
    echo %temp

on *:text:!test:#:{

However this is the output that I get:

HTTP/1.1 400 Bad Request
Server: nginx-rc
Date: Mon, 07 Jan 2019 23:57:25 GMT
Content-Type: text/html
Content-Length: 173
Connection: close
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>

Any idea how to fix this?

Last edited by Aiden; 08/01/19 12:02 AM.