1
Vote

HTTP_Client not working in local network

description

If I set local network IP to IntegratedSocket, I get error:
A first chance exception of type 'System.ArgumentException' occurred in System.Http.dll
An exception occured while connecting to the Internet. Please, make sure that a valid URL is used and a network connection is up.
Exception was thrown: System.ArgumentException

Of course I tested URL in browser and it works.
Problematic line:
HTTP_Client WebSession = new HTTP_Client(new IntegratedSocket("192.168.1.50", 80));

comments

Garrcomm wrote Sep 25, 2014 at 7:51 AM

Hi MaklaCof,

Maybe a silly question, but does your .NETMF device have a network connection? Normally that error occures when there is no connection available.

MaklaCof wrote Sep 25, 2014 at 8:11 AM

Of course. If I set some test server online, and change IP to mydomain.com it is working. At the same time I also send some request with WebClient.GetFromWeb and it is working. I just prefer your library.
But I can not afford to test things online.
I am using Cerberus from GHI and ETC28. But I think this doesn't matter since your code works when calling online.

MaklaCof wrote Sep 25, 2014 at 7:29 PM

I am truly sorry for bothering you. I disable firewall and it works. After all those years, I am still making beginners mistakes.

MaklaCof wrote Sep 25, 2014 at 7:35 PM

Still having trouble with parameters:
Sending: ?location=LivingRoomBehindCouch
Succeed: 2
OK
0


Sending: ?location=LivingRoomBehindCouch&temperature=27.329999999999998
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll
Error invoking method "Gadgeteer.Modules.GHIElectronics.TempHumidity" (check arguments to Program.BeginInvoke are correct)
Sending: ?location=LivingRoomBehindCouch
Succeed: 2
OK
0
Any idea?