Go Down

Topic: ethernet and lighttpd (Read 609 times) previous topic - next topic

as

I found the cause of the problem with lighttpd:
client.println("string") uses print to send the string in on packet, then \r in a second packet and \n in a thirth packet. And obviously ligttpd doesn't like that. If you use print("string\r\n"), lighttpd responses correctly. The last string in the message should end with double \r\n! Moreover, the communication is far more efficient: only 1 packet instead of 3!
Still better is to combine all strings in the message:

print("GET / HTTP/1.0\r\nHost: www.example.com\r\nUser-Agent: Arduino Ethernet\r\n\r\n");
This uses only 1 packet for the complete message.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy