Ethernet GET/POST, Querystrings and ASP

G’day all,

I’d like to send some information to a Microsoft IIS server running classic asp via a querystring that’s generated on the Arduino and sent along to my webserver.

I thought this would be quite elementary, but it’s not proving to be that way IRL.

All the webpage does is parse out the querystring data and insert it into a database - here’s that page :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<!--#INCLUDE FILE=""-->

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
	call CheckConxStatus
	ssql="insert into Test(TestData) values("
	ssql=ssql & stringsqlasp(request.querystring) & ")"
	response.write ssql & "


CheckConxStatus is just a function I’ve written to make the connection to my sql server database.
stringsqlasp is a helper function to add quotes around strings for SQL
gcnxconx is the SQL Server database connection object

If I navigate to this page directly, it works perfectly well.
The URL I use is ‘’, and this is the URL the Arduino needs to reconstruct and send to the server.

The Adruino (withi ether shield fitted) seems to connect to the server, but no data is inserted to the database. I’ve tried ‘POST’ instead of ‘GET’, but that (unsurprisingly) made no difference. In all my asp pages that use the querystring, ‘GET’ is what I use.

Here’s the Arduino sketch :

#include <Ethernet.h>
 #include <SPI.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
char serverName[] = "";
IPAddress ip(192,168,0,177);
IPAddress gateway(192,168,0,1);	
IPAddress subnet(255, 255, 255, 0);
EthernetClient client;
void setup()
   Ethernet.begin(mac, ip);

  if (client.connect(serverName, 8001)) {

    Serial.print("Connected to ");
    Serial.println("Making HTTP request...");
    //construct HTTP GET request to app engine:    
    String toGet = "GET /autoupload.asp?test=2&garb=yep/ HTTP/1.0";    
    //Make the request    
    //Pass a host header as well    
    client.print("HOST: ");
    client.println (serverName);    
    Serial.println("HTTP request completed.");

  }else {
     Serial.println("connection failed");

void loop()
   if (client.available()) {
     char c =;

What am I missing here? Any and all comments are welcomed.

Thanks in advance :slight_smile:

Try to change this one:

String toGet = "GET /autoupload.asp?test=2&garb=yep/ HTTP/1.0";

to this:

String toGet = "GET /autoupload.asp?test=2&garb=yep/ HTTP/1.1";

The server name is NOT It is

Thanks for your replies.

PaulS' suggestion has solved my problem - thanks Paul :grin: