TCP: Browser - 301 Error [gelöst]

Übersicht BlitzBasic Allgemein

Neue Antwort erstellen

Falling.down

Betreff: TCP: Browser - 301 Error [gelöst]

BeitragMo, Feb 22, 2010 16:04
Antworten mit Zitat
Benutzer-Profile anzeigen
hallo zusammn

Ich habe folgendes Problem:

Wenn ich das Beispiel von OpenTCPStream ausprobiere

BlitzBasic: [AUSKLAPPEN]
Graphics 800,600,0,2
Print "Verbinde..."
Local tcp,file
file=WriteFile("page.txt")
Local linie$
tcp = OpenTCPStream("www.blitzforum.de", 80)
If Not tcp Then
Print "Fehlgeschlagen"
WaitKey
End
EndIf
Print "Verbunden! Sende Anfrage..."
WriteLine tcp, "GET https://www.blitzforum.de/ HTTP/1.0"
WriteLine tcp, Chr$(10)
If Eof(tcp) Print "Fehlgeschlagen.": WaitKey: End
Print "Anfrage gesendet! Warte auf Antwort..."
While Not Eof(tcp)
linie=ReadLine$( tcp )
Print linie
WriteLine file,linie
WaitKey()
;Print "Bytes verfügbar:" + ReadAvail(tcp)
Wend
If Eof(tcp) = 1 Then
Print "Erfolgreich!"
Else
Print "Fehler!"
EndIf
CloseTCPStream tcp
WaitKey()
End


wird zwar das Programm an sich richtig ausgeführt, aber ich komme folgende Seite:

Code: [AUSKLAPPEN]
HTTP/1.1 301 Moved Permanently
Date: Mon, 22 Feb 2010 14:00:59 GMT
Server: Apache/2.2.3 (Debian) DAV/2 SVN/1.4.2 PHP/5.2.0-8+etch16 mod_ssl/2.2.3 OpenSSL/0.9.8c
Location: http://www.blitzforum.de/
Content-Length: 233
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.blitzforum.de/">here</a>.</p>
</body></html>


also ein 301 Error..

auch bei Google geschied das selbe...

kann mir jemand helfen? Confused
  • Zuletzt bearbeitet von Falling.down am Mo, Feb 22, 2010 16:33, insgesamt einmal bearbeitet

D2006

Administrator

BeitragMo, Feb 22, 2010 16:08
Antworten mit Zitat
Benutzer-Profile anzeigen
in die GET-Zeile kommt nur der Teil hinter der TLD, also nur "/". Dafür brauchst du aber noch eine Zeile "Host: www.blitzforum.de", die immer da sein muss.
Intel Core i5 2500 | 16 GB DDR3 RAM dualchannel | ATI Radeon HD6870 (1024 MB RAM) | Windows 7 Home Premium
Intel Core 2 Duo 2.4 GHz | 2 GB DDR3 RAM dualchannel | Nvidia GeForce 9400M (256 MB shared RAM) | Mac OS X Snow Leopard
Intel Pentium Dual-Core 2.4 GHz | 3 GB DDR2 RAM dualchannel | ATI Radeon HD3850 (1024 MB RAM) | Windows 7 Home Premium
Chaos Interactive :: GoBang :: BB-Poker :: ChaosBreaker :: Hexagon :: ChaosRacer 2

Falling.down

BeitragMo, Feb 22, 2010 16:14
Antworten mit Zitat
Benutzer-Profile anzeigen
herzlichen Dank Very Happy

Neue Antwort erstellen


Übersicht BlitzBasic Allgemein

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group