Ich brauche mal Hilfe von den Webabfragen-Profis:
Vorwort:
Ich möchte im HS einen dyndns-Updater realisieren, weil in einem projekt die Router das zwar können sollten, es aber nicht tun.
Dyndns bietet eine API an, die genau beschreibt, wie ein GET-Request aussehen soll. Es gibt auch eine Möglichkeit bei dyndns, die aktuelle IP zu bestimmen: checkip
Funktion:
Ich prüfe zyklisch mit einer Webabfrage über Checkip, ob sich die IP geandert hat. WICHTIG: Das darf höchstens alle 10 Minuten erfolgen, sonst wird man geblockt. Habe ich eine neue IP erhalten, soll die mit einer zweiten WA bei dyndns aktualisiert werden.
Ich kann das problemlos im Browser direkt erledigen. Einfach ein Anfrage in der Form senden:
http://members.dyndns.org/nic/update...G&backmx=NOCHG
Dann Benutzer und Passwort eingeben, fertig. (test, test)
Das soll der HS erledigen, und da scheitere ich bisher.
10.12.2008 12:20:56 (IP: members.dyndns.org) (Port: 80)
(Send: 193) 0x47 0x45 0x54 0x20 0x2f 0x6e 0x69 0x63 0x2f 0x75 0x70 0x64 0x61 0x74 0x65 0x3f 0x68 0x6f 0x73 0x74 0x6e 0x61 0x6d 0x65 0x3d 0x74 0x65 0x73 0x74 0x2e 0x6d 0x65 0x72 0x73 0x65 0x69 0x6e 0x65 0x2e 0x6e 0x75 0x26 0x6d 0x79 0x69 0x70 0x3d 0x38 0x34 0x2e 0x31 0x34 0x39 0x2e 0x34 0x34 0x2e 0x32 0x33 0x35 0x26 0x77 0x69 0x6c 0x64 0x63 0x61 0x72 0x64 0x3d 0x4e 0x4f 0x43 0x48 0x47 0x26 0x6d 0x78 0x3d 0x4e 0x4f 0x43 0x48 0x47 0x26 0x62 0x61 0x63 0x6b 0x6d 0x78 0x3d 0x4e 0x4f 0x43 0x48 0x47 0x20 0x48 0x54 0x54 0x50 0x2f 0x31 0x2e 0x30 0xd 0xa 0x55 0x73 0x65 0x72 0x20 0x41 0x67 0x65 0x6e 0x74 0x3a 0x20 0x46 0x69 0x64 0x64 0x6c 0x65 0x72 0xd 0xa 0x48 0x6f 0x73 0x74 0x3a 0x20 0x6d 0x65 0x6d 0x62 0x65 0x72 0x73 0x2e 0x64 0x79 0x6e 0x64 0x6e 0x73 0x2e 0x6f 0x72 0x67 0xd 0xa 0x20 0x41 0x75 0x74 0x68 0x6f 0x72 0x69 0x7a 0x61 0x74 0x69 0x6f 0x6e 0x3a 0x20 0x42 0x61 0x73 0x69 0x63 0x20 0x64 0x47 0x56 0x7a 0x64 0x44 0x70 0x30 0x5a 0x58 0x4e 0x30 0xd 0xa 0xd 0xa
GET /nic/update?hostname=test.dyndns.org&myip=84.149.44.235 &wildcard=NOCHG&mx=NOCHG&backmx=NOCHG HTTP/1.0 User Agent: Fiddler Host: members.dyndns.org Authorization: Basic dGVzdDp0ZXN0
(Recv: 250) 0x48 0x54 0x54 0x50 0x2f 0x31 0x2e 0x31 0x20 0x34 0x30 0x31 0x20 0x41 0x75 0x74 0x68 0x6f 0x72 0x69 0x7a 0x61 0x74 0x69 0x6f 0x6e 0x20 0x52 0x65 0x71 0x75 0x69 0x72 0x65 0x64 0xd 0xa 0x44 0x61 0x74 0x65 0x3a 0x20 0x57 0x65 0x64 0x2c 0x20 0x31 0x30 0x20 0x44 0x65 0x63 0x20 0x32 0x30 0x30 0x38 0x20 0x31 0x31 0x3a 0x32 0x30 0x3a 0x35 0x32 0x20 0x47 0x4d 0x54 0xd 0xa 0x53 0x65 0x72 0x76 0x65 0x72 0x3a 0x20 0x41 0x70 0x61 0x63 0x68 0x65 0xd 0xa 0x58 0x2d 0x55 0x70 0x64 0x61 0x74 0x65 0x43 0x6f 0x64 0x65 0x3a 0x20 0x41 0xd 0xa 0x57 0x57 0x57 0x2d 0x41 0x75 0x74 0x68 0x65 0x6e 0x74 0x69 0x63 0x61 0x74 0x65 0x3a 0x20 0x42 0x61 0x73 0x69 0x63 0x20 0x72 0x65 0x61 0x6c 0x6d 0x3d 0x22 0x44 0x79 0x6e 0x44 0x4e 0x53 0x20 0x41 0x50 0x49 0x20 0x41 0x63 0x63 0x65 0x73 0x73 0x22 0xd 0xa 0x43 0x6f 0x6e 0x74 0x65 0x6e 0x74 0x2d 0x4c 0x65 0x6e 0x67 0x74 0x68 0x3a 0x20 0x37 0xd 0xa 0x43 0x6f 0x6e 0x6e 0x65 0x63 0x74 0x69 0x6f 0x6e 0x3a 0x20 0x63 0x6c 0x6f 0x73 0x65 0xd 0xa 0x43 0x6f 0x6e 0x74
HTTP/1.1 401 Authorization Required Date: Wed, 10 Dec 2008 11:20:52 GMT Server: Apache X-UpdateCode: A WWW-Authenticate: Basic realm="DynDNS API Access" Content-Length: 7 Connection: close Cont
(Gesamt: 1) (Work: 1) (Typ: Liste) (OK: 1)
Kann mir da mal einer behilflich sein?
Vorwort:
Ich möchte im HS einen dyndns-Updater realisieren, weil in einem projekt die Router das zwar können sollten, es aber nicht tun.
Dyndns bietet eine API an, die genau beschreibt, wie ein GET-Request aussehen soll. Es gibt auch eine Möglichkeit bei dyndns, die aktuelle IP zu bestimmen: checkip
Funktion:
Ich prüfe zyklisch mit einer Webabfrage über Checkip, ob sich die IP geandert hat. WICHTIG: Das darf höchstens alle 10 Minuten erfolgen, sonst wird man geblockt. Habe ich eine neue IP erhalten, soll die mit einer zweiten WA bei dyndns aktualisiert werden.
Ich kann das problemlos im Browser direkt erledigen. Einfach ein Anfrage in der Form senden:
http://members.dyndns.org/nic/update...G&backmx=NOCHG
Dann Benutzer und Passwort eingeben, fertig. (test, test)
Das soll der HS erledigen, und da scheitere ich bisher.
10.12.2008 12:20:56 (IP: members.dyndns.org) (Port: 80)
(Send: 193) 0x47 0x45 0x54 0x20 0x2f 0x6e 0x69 0x63 0x2f 0x75 0x70 0x64 0x61 0x74 0x65 0x3f 0x68 0x6f 0x73 0x74 0x6e 0x61 0x6d 0x65 0x3d 0x74 0x65 0x73 0x74 0x2e 0x6d 0x65 0x72 0x73 0x65 0x69 0x6e 0x65 0x2e 0x6e 0x75 0x26 0x6d 0x79 0x69 0x70 0x3d 0x38 0x34 0x2e 0x31 0x34 0x39 0x2e 0x34 0x34 0x2e 0x32 0x33 0x35 0x26 0x77 0x69 0x6c 0x64 0x63 0x61 0x72 0x64 0x3d 0x4e 0x4f 0x43 0x48 0x47 0x26 0x6d 0x78 0x3d 0x4e 0x4f 0x43 0x48 0x47 0x26 0x62 0x61 0x63 0x6b 0x6d 0x78 0x3d 0x4e 0x4f 0x43 0x48 0x47 0x20 0x48 0x54 0x54 0x50 0x2f 0x31 0x2e 0x30 0xd 0xa 0x55 0x73 0x65 0x72 0x20 0x41 0x67 0x65 0x6e 0x74 0x3a 0x20 0x46 0x69 0x64 0x64 0x6c 0x65 0x72 0xd 0xa 0x48 0x6f 0x73 0x74 0x3a 0x20 0x6d 0x65 0x6d 0x62 0x65 0x72 0x73 0x2e 0x64 0x79 0x6e 0x64 0x6e 0x73 0x2e 0x6f 0x72 0x67 0xd 0xa 0x20 0x41 0x75 0x74 0x68 0x6f 0x72 0x69 0x7a 0x61 0x74 0x69 0x6f 0x6e 0x3a 0x20 0x42 0x61 0x73 0x69 0x63 0x20 0x64 0x47 0x56 0x7a 0x64 0x44 0x70 0x30 0x5a 0x58 0x4e 0x30 0xd 0xa 0xd 0xa
GET /nic/update?hostname=test.dyndns.org&myip=84.149.44.235 &wildcard=NOCHG&mx=NOCHG&backmx=NOCHG HTTP/1.0 User Agent: Fiddler Host: members.dyndns.org Authorization: Basic dGVzdDp0ZXN0
(Recv: 250) 0x48 0x54 0x54 0x50 0x2f 0x31 0x2e 0x31 0x20 0x34 0x30 0x31 0x20 0x41 0x75 0x74 0x68 0x6f 0x72 0x69 0x7a 0x61 0x74 0x69 0x6f 0x6e 0x20 0x52 0x65 0x71 0x75 0x69 0x72 0x65 0x64 0xd 0xa 0x44 0x61 0x74 0x65 0x3a 0x20 0x57 0x65 0x64 0x2c 0x20 0x31 0x30 0x20 0x44 0x65 0x63 0x20 0x32 0x30 0x30 0x38 0x20 0x31 0x31 0x3a 0x32 0x30 0x3a 0x35 0x32 0x20 0x47 0x4d 0x54 0xd 0xa 0x53 0x65 0x72 0x76 0x65 0x72 0x3a 0x20 0x41 0x70 0x61 0x63 0x68 0x65 0xd 0xa 0x58 0x2d 0x55 0x70 0x64 0x61 0x74 0x65 0x43 0x6f 0x64 0x65 0x3a 0x20 0x41 0xd 0xa 0x57 0x57 0x57 0x2d 0x41 0x75 0x74 0x68 0x65 0x6e 0x74 0x69 0x63 0x61 0x74 0x65 0x3a 0x20 0x42 0x61 0x73 0x69 0x63 0x20 0x72 0x65 0x61 0x6c 0x6d 0x3d 0x22 0x44 0x79 0x6e 0x44 0x4e 0x53 0x20 0x41 0x50 0x49 0x20 0x41 0x63 0x63 0x65 0x73 0x73 0x22 0xd 0xa 0x43 0x6f 0x6e 0x74 0x65 0x6e 0x74 0x2d 0x4c 0x65 0x6e 0x67 0x74 0x68 0x3a 0x20 0x37 0xd 0xa 0x43 0x6f 0x6e 0x6e 0x65 0x63 0x74 0x69 0x6f 0x6e 0x3a 0x20 0x63 0x6c 0x6f 0x73 0x65 0xd 0xa 0x43 0x6f 0x6e 0x74
HTTP/1.1 401 Authorization Required Date: Wed, 10 Dec 2008 11:20:52 GMT Server: Apache X-UpdateCode: A WWW-Authenticate: Basic realm="DynDNS API Access" Content-Length: 7 Connection: close Cont
(Gesamt: 1) (Work: 1) (Typ: Liste) (OK: 1)
Kann mir da mal einer behilflich sein?
Kommentar