2
votes

I am trying to communicate with my hosted server using an Arduino Ethernet shield.

Now the problem is this:

Using a web browser, I can see that calling the URL works fine, but calling the IP address does not. I assume that the hosting provider hosts several different URLs using the same IP address.

How can I make a URL dependent call from within the Arduino libraries? The standard Arduino libraries only require the IP address of my host, not the URL.

2
you're probably hosted via http/1.1 named-based vhost, which REQUIRE a valid Host: header in the http request. poking at the bare IP address doesn't work, because the webserver won't know WHICH of the many sites on that IP you're trying to access.Marc B
Could you post some code to show us what you're working with?ZnArK

2 Answers

2
votes

You need to ensure the http GET/POST request has the correct Host field. Here's a sample get request from http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html

There's a lot of good technical information on this site.

Sample HTTP Get Request:

 GET /pub/WWW/TheProject.html HTTP/1.1
 Host: www.w3.org

This may require some customization of your code, but should do the trick !!