mIRC Home    About    Download    Register    News    Help

Print Thread
#210873 27/03/09 03:46 PM
Joined: Feb 2007
Posts: 91
S
spermis Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2007
Posts: 91
I cant figure out, how to get a content from webpage, because when I open it with sockets, all it gets is this:
Code:
Moved Permanently
The document has moved here.
Apache/2.2.11 (Debian) Server at ** Port 80

Could someone help me with this here? I think it has something to do with redirects.

spermis #210875 27/03/09 07:08 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
That is a redirect. You need to follow the redirection and request the subsequent document as all browsers do.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #210877 27/03/09 10:16 PM
Joined: Feb 2007
Posts: 91
S
spermis Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2007
Posts: 91
Originally Posted By: argv0
That is a redirect. You need to follow the redirection and request the subsequent document as all browsers do.
As i said, i know that it does redirect, but i cant understand how to do that.

spermis #210878 27/03/09 10:24 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
The Location header contains the URL you should be sending your next request. Take that value and build a new request.

http://en.wikipedia.org/wiki/HTTP_302

Though Moved Permanently is actually 301, the method is the same.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard