G
Guest
I have a very wired problem requesting one specific url from within my
application.
I have struggeled with this for 5 hours now, and searched google withour any
luck, so i hope that someone are able to help me.
Here is the code that i am using:
Dim url As String = "MyIP"
Dim httpRequest As HttpWebRequest = CType(WebRequest.Create(url),
HttpWebRequest)
Dim httpResponse As HttpWebResponse = CType(httpRequest.GetResponse,
HttpWebResponse)
The erro that i get is the following:
"The underlying connection was closed: An unexpected error occurred on a
receive."
Then i downloaded HTTP Analyzer to see what was going on behind the scenes.
When requesting the url from within IE, the content is returned to the
browser windows without any problems, but when the request is made using a
HttpWebRequest strange things happen.
When i monitor what i happening in HTTP Analyser is see that the request is
made from my asp.net program, and the content and a status 200 is returned,
BUT about 500 miliseconds later another request is made to the resource (i
can see that in the monitor program) and this time no content is returned.
This is probabaly why the the framework see this as a malformed response, and
i get the error above.
I have tested the code with 10-15 other addresses with success. The content
is returned, and the resoruce is only requested 1 time. Has anyone seen this
before ?
What is a little bit special about the resource that i request is that the
content is returned with no header info at all, only raw text, but why should
this mean that the resource is accessed two times, when i only call
httpRequest.GetResponse one time.
The resource that i access is a simple url hosted on a Apace server which
retuns a text string with no header info at all.
I hope that someone can help me on this, as i think i have tested for
everything.
thanks,
Oliver
application.
I have struggeled with this for 5 hours now, and searched google withour any
luck, so i hope that someone are able to help me.
Here is the code that i am using:
Dim url As String = "MyIP"
Dim httpRequest As HttpWebRequest = CType(WebRequest.Create(url),
HttpWebRequest)
Dim httpResponse As HttpWebResponse = CType(httpRequest.GetResponse,
HttpWebResponse)
The erro that i get is the following:
"The underlying connection was closed: An unexpected error occurred on a
receive."
Then i downloaded HTTP Analyzer to see what was going on behind the scenes.
When requesting the url from within IE, the content is returned to the
browser windows without any problems, but when the request is made using a
HttpWebRequest strange things happen.
When i monitor what i happening in HTTP Analyser is see that the request is
made from my asp.net program, and the content and a status 200 is returned,
BUT about 500 miliseconds later another request is made to the resource (i
can see that in the monitor program) and this time no content is returned.
This is probabaly why the the framework see this as a malformed response, and
i get the error above.
I have tested the code with 10-15 other addresses with success. The content
is returned, and the resoruce is only requested 1 time. Has anyone seen this
before ?
What is a little bit special about the resource that i request is that the
content is returned with no header info at all, only raw text, but why should
this mean that the resource is accessed two times, when i only call
httpRequest.GetResponse one time.
The resource that i access is a simple url hosted on a Apace server which
retuns a text string with no header info at all.
I hope that someone can help me on this, as i think i have tested for
everything.
thanks,
Oliver