Hello,
Some assistance would be appreciated on this matter. I have searched the forums for some answers and have tried the following:
WiFiClient client;
//IPAddress server(149,255,60,143); // numeric IP for Webserver (no DNS)
char server[] = "saavanhirani.co.uk"; // name address for Webserver
String headerTwo = "GET /test/php/Arduino.txt";
String footerOne = " HTTP/1.0";
if(stringThree != 0) {
client.print(headerTwo);
Serial.print(headerTwo);
// client.print(headerOne);
// Serial.print(headerOne);
// client.print(stringOne);
// Serial.print(stringOne);
// client.print(stringTwo);
// Serial.print(stringTwo);
// client.print(stringThree);
// Serial.print(stringThree);
// client.print(stringFour);
// Serial.print(stringFour);
client.println(footerOne);
Serial.println(footerOne);
client.println("Host: www.saavanhirani.co.uk");
Serial.println("Host: www.saavanhirani.co.uk");
client.println("Connection: close");
Serial.println("Connection: close");
client.println();
Serial.println();
while(client.connected() && !client.available()) delay(1);
while(client.connected() || client.available()) {
char c = client.read();
Serial.write(c);
}
delay(100);
}
Here is the output from the serial monitor:
GET /test/php/Arduino.txt HTTP/1.0
Host:saavanhirani.co.uk
Connection: close
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.
045</p>
<hr>
<address>Apache Server at default Port 80</address>
</body></html>
So I have tried adding the \n\r's to the end of my lines with no joy, even tried adjusting HTTP1.1 to 1.0 for those permutations with no joy. Have tried changing the directory the files are stored in on my web space.
So I have been using the Arduino.txt just to see if I can actaully GET this test file. My end game is to be able to request:
GET /test/php/parse.php?id=xxxxxxxxxxxx HTTP/1.1
Hope this is enough information, please let me know if you need more.
Thanks.