WebClient to Tenda Router communication redirect message

Hello

I am Trying to down load the index page of my TENDA router.

I modified the following lines of code in the WEBclient software:

char server[] = "192.168.0.1"; // the Tenda router
client.println("GET /index.asp HTTP/1.0");
client.println("Host: ");

I get the following reply:

connecting...
connected
HTTP/1.0 302 Redirect
Server: GoAhead-Webs
Date: Sat Nov 09 05:19:32 2013
Set-Cookie: admin:language=en; path=/
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html
Location: http://192.168.0.1/index.asp

I thought that the line client.println("GET /index.asp HTTP/1.0"); would got to the index.asp
Any thoughts??

Thank you
Lou

Try declaring the server like this:

IPAddress server(192,168,0,1);

Thank You for your suggestion: try IPAddress server(192,168,0,1);
I received the same reply:

connecting...
connected
HTTP/1.0 302 Redirect
Server: GoAhead-Webs
Date: Sat Nov 09 21:37:12 2013
Set-Cookie: admin:language=en; path=/
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html
Location: http://192.168.0.1/index.asp

I will try some different forms of the line. Something like IPAddress server(192,168,0,1/index.asp);

Lou

Something like IPAddress server(192,168,0,1/index.asp);

Suit yourself. That won't work.

Post ALL of your code.

I found out that the following client.println statements are need to communicate with the Tenda router:

client.println("GET /index.asp HTTP/1.1");
client.println("Host: 192.168.0.1");
client.println("Cookie: admin:language=en");

I added a client.println("Connection: close"); line also but this did not seem necessary.

The "Cookie Line seems to have eliminated the error I was getting. Does anyone know what is the reason???

I eventually changed the "GET /index.asp HTTP/1.1"" line to client.println("GET /system_status.asp HTTP/1.1");
where I able to get my IP address. I hope to use this to update my DNS. That's next.

I know that their are web sites where I can get my IP but I thought it was better to get the IP from my router. Then I do not have to worry about a web site changing its site.

LOU