mIRC Home    About    Download    Register    News    Help

Print Thread
#207747 30/12/08 08:58 PM
Joined: Sep 2007
Posts: 109
K
kwell Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Sep 2007
Posts: 109
I get the following problem
Code:
HTTP/1.1 400 Bad Request
Content-Type: text/html
Date: Tue, 30 Dec 2008 18:51:28 GMT
Connection: close
Content-Length: 20


Code:
on 1:sockopen:open: { 
  if $sockerr > 0 { echo -a Error: $sock($sockname).wsmsg 
    return 
  }
  sockwrite -n $sockname POST <link> HTTP/1.1
  sockwrite -n $sockname User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; FDM)
  sockwrite -n $sockname Accept: *.*, */*
  sockwrite -n $sockname Connection: Keep-Alive
  sockwrite -n $sockname Content-Type: text/html
  sockwrite -n $sockname $crlf
}

Any idea?

kwell #207748 30/12/08 09:28 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
HTTP 1.1 requires a Host header.

kwell #207749 30/12/08 09:38 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
When you say "<link>", what exactly do you have there? It should only include the path portion of the URL. For example if the URL was http://moo.com/hello/blah.jpg you should have /hello/blah.jpg there.

Also you should have a Host header. In fact since you're sending an HTTP 1.1 request it is required. Add an extra sockwrite line to your sockopen event:
Code:
sockwrite -n $sockname Host: moo.com

(where moo.com is the host portion of the URL).


Spelling mistakes, grammatical errors, and stupid comments are intentional.

Link Copied to Clipboard