nuelectronics ethernet shield: request webpages?

hello people

i have a nuelectronics ethernet shield and the examples i downloaded from teh site are working fine.
but they are all about serving information (ping, webserver, etc.)

and i would like to request information from a remote webpage.

can anyone give me any clue how to go about doing that? the webserving code alone is pretty complicated for my skills so i don’t even know where to start to have it make requests… :-[

you'll need to write some code to talk http

A http request basically looks like:

// declare variables int conn; char lastc, c; // connect to host:port, port is 80 for http conn = connectTo(host, 80); // request url fprintf(conn, "GET %s HTTP/1.1\nHost: %s\nConnection: close\n\n", url, host); // skip header, 10 and 13 are newline characters and header ends after two consecutive newlines for (lastc = 0; (c != 10 && c != 13) || (lastc != 10 && lastc != 13); lastc = c; c = getc(conn)); // now do something useful with the remaining data

thanks. there's quite a lot of info on the web about structuring an http request; the bit that i don't know how to do is actually communicating with the shield and getting it to make the request -- which i suppose are the 'connectTo' and 'getc' functions in your code. any suggestions on that part of the problem?

You're gonna have a problem sending out requests.

Most packets sent over the internet are 1500 bytes. The atmega168 on your arduino has 1024 bytes of ram. When the requests are smaller than 1024 bytes it's not a problem, but packets from webservers will easily be bigger than this amount and you'll have to be extremely crafty with your ram usage. Not to mention that you also need ram to store arp tables, tcp sequence numbers, the stack, and any variables your program uses..

Basically, if you manage to do this, you'll be processing the packets as they come in without storing them and you will have rewritten most of the source that nuelectronics provides with the shield.

Maybe that's why they didn't provide any functions for making outgoing requests?

See http://www.sics.se/~adam/uip/index.php/Main_Page for a tcp/ip stack that has most of the above but is still small enough to fit on a microcontroller (although not the arduino's atmega168)

aha! thanks for the detailed reply....

i will soldier on and report back if i manage to knock something up.