Re: Problems with HttpWebRequest

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I now see that the url returns a HTTP/1.0 200 Simple Response, where as other
urls that i have tried with the HttpWebRequest returns a HTTP/1.1 200 OK
response. Could this 'Simple Response' be the problem ?

"Scott Allen" wrote:

> Does the initial request cause a redirect to a default page?
> You might want to set AllowAutoRedirect to false and see what happens.
> I know you said the server does not return a header, but a redirect
> would cause 2 requests fromt the client.
>
> --
> Scott
> http://www.OdeToCode.com/blogs/scott/
>
> On Sun, 2 Oct 2005 09:24:02 -0700, Oliver
> <Oliver@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> >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
>
>
.



Relevant Pages

  • Re: W2K3 IIS 6.0 ASP.NET Requests Per Second Limits?
    ... allow the page to tell ASP.Net "don't send a response yet until I tell ... this request is "leaked" and will never ... It is when the callback executes with both the async function call ... The thread executing code literally calls into Function1, execute code, ...
    (microsoft.public.inetserver.iis)
  • Re: Page updates
    ... value from the response to an HTTP request. ... the nature and purpose of strong and weak validators. ... value for any one resource can be correct but misleading. ...
    (uk.net.web.authoring)
  • Re: Can extra processing threads help in this case?
    ... The child process is terminated if a timeout occurs or the client connection drops which can easily happen when users switch to new pages and/or clicking another link when the browser hour glass is active waiting for a response. ... Whether he realizes it or not, I lean on not, his Many Threads to 1 FIFO OCR thread design (he now says four, 1 for each type of request), requires a thread handle to send back a result to the request thread waiting for a response. ... 100 TPS ... 100 ms PPT (Processing time Per Transaction) ...
    (microsoft.public.vc.mfc)
  • Re: W2K3 IIS 6.0 ASP.NET Requests Per Second Limits?
    ... >> The way I understand async programming is if u need to do other ... >> request to webservice nothing more can be done until the result ... > The thread executing code literally calls into Function1, ... > the act of sending back the response using data that has been ...
    (microsoft.public.inetserver.iis)
  • ADFS & Sharepoint 2007 Errors
    ... Request or Response. ... claim Group = adfstest readers for user sid ... Sign In Response Dump ...
    (microsoft.public.windows.server.active_directory)