473,503 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Webrequest to server that returns a string

KSC
Hello,

I am trying to access an ethernet temperature probe in my app.
The probe is properly configured. Using IE I can access the data using the
IPaddress & "/temp". This returns a string containing data from a number of
temperature probes attached to the hub.
For example:
input "http://192.168.1.110/temp"
returns "Probe 1|75.5|Probe 2|78.9|Probe 3|-99.9|Probe 4|-99.9"

In my app, I am using a WebRequest as in the documentation:

Public Function TemperatureData(ByVal url As String) As String
Try
Dim wReq As WebRequest = WebRequest.Create(url)
Dim wRes As HttpWebResponse = DirectCast(wReq.GetResponse,
HttpWebResponse)
Dim sr As New StreamReader(wRes.GetResponseStream)

return sr.ReadToEnd

Catch Exc As Exception
msgbox(exc.tostring)
End Try
End Function

When I pass the URL as in the example above, I get the following error:
System.Net.WebException: The underlying connection was closed: An unexpected
error occurred on a receive.

When I pass the URL without "/temp", the function returns the HTML code for
the probe's default page as expected.

Why does this code successfully return the html page, but not the string data?

Thanks in advance for any help!
Nov 21 '05 #1
0 929

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1675
by: Adam Stirk | last post by:
Hi, I am trying to download a image that is generated by PHP using HttpWebRequest, I believe the server uses cookies to generate the image, but I keep getting the error image from the server. ...
2
9684
by: gizmo | last post by:
Hi, I'm using the following code to request the html source from the quoted site. ...... string url = "http://www1.soccerstand.com/"; WebRequest webRequest = WebRequest.Create(url);...
2
3954
by: Stephen Miller | last post by:
I have an ASPX report and I want to capture the rendered HTML and write to a file on the webserver. Several posts suggest using WebRequest to make a second call to the page, and screen-scrape the...
8
2384
by: John K. | last post by:
Hi I was wondering if it's possible to use the WebRequest class to access a file on windows shared folder with authentication? If yes, what would the syntax be? I've tried to look this up in the...
4
7216
by: Terry | last post by:
Hello, I am trying to get a response for an .aspx page in my current project (same virtual directory) by using WebRequest.GetResponse but I keep getting a exception with "500 Internal server...
12
2847
by: ThyRock | last post by:
I am working on a WebRequest accessing the US Postal Service WebTools test API. This service uses a DLL file (ShippingAPITest.dll) with a query string which includes XML. The web service accepts...
1
1323
by: Dave56 | last post by:
I have an asp.net web service that is posting data to another web server. My code (somewhat simplified) looks like this: 'Convert string to byte array Dim bodyBytes() As Byte =...
1
3148
by: Dave | last post by:
I'm trying to make a webrequest to another server on our webfarm (to synch the cache as explained in http://www.eggheadcafe.com/articles/20030420.asp) but I'm getting a 401 unauthorized error. ...
0
1194
by: tascien | last post by:
Hi guys, when i use winhttp, and the server returns status 500, I get the text that the server returned anyway... when i use webrequest, and the server returns status 500, webrequest just...
0
7083
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.