Go Down

Topic: HTTP/1.1 request wifi RN-XV (Read 433 times) previous topic - next topic

sebs

Hi guys,

I try to make a HTTP request on a server from my wifi RN-XV.

The configuration of the server forces us to use a HTTP request 1.1 in order to precise the Host.

Programmatically, I tried this code :


Quote
//Command mode
$$$

//connexion to internet
set wlan phrase PasswordNetwork
set wlan ssid NameNetwork
join Network

//Server configuration
set ip proto 18
set dns name myserver.server.com
set ip address 0
set ip remote 80
set com remote 0

open

//Send HTTP request
GET /Service/Server.php HTTP/1.1


My problem is that i can't precise the Host when the HTTP request is sent. This request is directly done in HTTP/1.0 instead of HTTP/1.1

Quote

open

<2.32>
*OPEN*HTTP/1.0


Do you have any idea how I can solve my problem, how i can do an http request in 1.1?

Config :
Arduino 1.0.3
Arduino Uno
Module Wifi RN-XV
Xbee Shield (USB mode)


Thanks a lot!!

tack

You had this working with a HtTP 1.0 request? What was that code?

For virtual/name based hosting you would normally just send a 'HOST: www.yourdomain.com' after your GET string.

sebs

Hi,

Thank you for your attention.


Here is how I proceed :
(output of the serial monitor ; in brown are the command I'm entering, in black the output of the arduino. I also precise you the mode of the monitor.)

Quote

// > No Line Ending mode
$$$
CMD

// > NL & CR mode
set wlan phrase homeconnect2013

AOK
<2.32>

// > NL & CR mode
set wlan ssid homeconnect

AOK
<2.32>

// > NL & CR mode
join homeconnect

Auto-Assoc homeconnect chan=6 mode=WPA2 SCAN OK
Joining homeconnect now..
<2.32>
Associated!
DHCP: Start
DHCP in 5011ms, lease=3600s
IF=UP
DHCP=ON
IP=192.168.43.219:2000
NM=255.255.255.0
GW=192.168.43.1
Listen on 2000

// > NL & CR mode
set ip proto 18

AOK
<2.32>

// > NL & CR mode
set dns name homeconnect.ece.fr

AOK
<2.32>

// > NL & CR mode
set ip address 0

AOK
<2.32>

// > NL & CR mode
set ip remote 80

AOK
<2.32>

// > NL & CR mode
set com remote 0

AOK
<2.32>

// > NL & CR mode
open

<2.32>
*OPEN*

// > New Line Mode
GET /Service/Server.php HTTP/1.1

HTTP/1.0 503 Service Unavailable
Cache-Control: no-cache
Connection: close
Content-Type: text/html



<html>
        <head>
                <title>ECE Paris </title>

        </head>
        <body bgcolor="#ffffff" >
        <table border="0" valign="center" cellpadding="0" cellspacing="0" height="100%" width="100%">
        <tr><td align="center">

        <table width="680" bgcolor="#ffffff" border="1" bordercolor="#4E7ABB" cellpadding="0" cellspacing="0">
                <tr><td>

                <table width="100%" border="0" cellpadding="5" cellspacing="5">

                <tr><td align="center" colspan="2" bgcolor="#ffffff">






                <font face="Arial,Helvetica" color="#0000000">
                <strong>               Erreur :<br> Le nom sp&eacute;cifi&eacute; ne correspond &agrave; aucun site web.<br>
        </strong><br><br>
                </font>

                <br>
                   <br>
                <font face="Arial,Helvetica" size="2" color="#787878">

                <strong>GROUPE ECE</strong><br>Immeuble POLLUX<br>37 Quai de grenelle, CS 71520<br>75725 PARIS CEDEX 15<br>www.ece.fr - webmaster@ece.fr
<br> T&eacute;l. : 01 44 39 06 00<br />
        Fax : 01 42 22 59 02<br />
        </td>                </tr>

        </td></tr></table>

        </td></tr></table>


        </table>
        </table>
        </table>


</font>

</table>

</td></tr></table>
</td></tr></table>


</body>
</html>
*CLOS*


As you can see after opening the connection, the request is sent in HTTP/1.0 even if I precise the 1.1 in the GET request and if I'm in new line mode...

Also it doesn't let me precise the host, the request is executed directly..

Any idea ? :/

magagna

That is not strictly how you make a HTTP 1.1 request. It needs to be 3 lines:

* the get
* the host
* the user agent

See http://www.the-art-of-web.com/system/telnet-http11/#.UP1lAJzTkgU for an example.

Good luck!
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Go Up