asp.net - Not generating a complete response from a HttpWebResponse object in C# -


I am creating an HttpWebRequest object from another aspx page to save the response stream in my data collection. The url I am using to create the HttpWebRequest object is the querystring to render the correct output. When I browse the page using any older browser then it renders correctly I try to retrieve the output stream using HttpWebResponse.GetResponseStream (try rendering it in my error check

Why is this rendered correctly in the browser, but not using the HttpWebRequest and HttpWebResponse objects?

Here is the source code:

Code Behind the target page:

< Pre = protected zero pageload (object sender, EventsArgs E) {string output = string. Empty; if (Request.Querystring ["a"]! = Null) {// Generated output output = "query string value" Requested output output = "query string value not found";} response. Compose (output);} .jQueryString ["a"]. ToString ();} Else {// generated query indicating string variable variable; >

HttpWebRequest object behind creating code page

  string url = "http://www.mysite.com/mypage.aspx?a=1"; HttpWebRe Quest request = (HttpWebRequest) WebRequest.Create (URL) // If this statement was missing from the original example (User.Length & gt; 0) {request.Credentials = New NetworkCredentials ("MyAccount", "mypassword", "mydomain"); request. Authentic = true; } Request.UserAgent = Request.UserAgent; HttpWebResponse response = (HttpWebResponse) request.GetResponse (); Stream stream = response Gateresonsstream (); Encoding encode = System.Text.Encoding.GetEncoding ("utf-8"); Stream Reader Reading Stream = New Streammorder (RestStream, Encoded, True, 2000); Int count = readStream.Read (Read, 0, read Lang); String str = Server.HtmlEncode (""); While (Calculation gt; 0) dumps 256 characters to the string {// string and displays the string of the console. String strRead = new string (read, 0, count); Str = str.Replace (str, str + Server.HtmlEncode (strRead.ToString ()); Count = readstream.Read (Read, 0, 256); } // Return what was found = str.ToString (); ResStream.Close (); ReadStream.Close (); The    page is still generating error output. I've updated the code sample of the targeted page correctly to see what I am doing.  

@Chris Lively - I'm not redirected to an error page, I do not generate a message pointing to the query string value. I update the source code example

Update 1:.

I tried using Fidler to detect HttpWebRequest and it was not visible in the Web session history window Do I miss something in my source code to get the full web request and feedback?

Update 2:

I did not include the following part of the code in my example and it was an issue of crime. I had established the credentials property of HttpWebRequest which was causing the problem with a sevice account instead of my e-account.

I update my source code example

Which webserver are using ? I can remember in my past at one point when I was doing something with IIS, then there was a problem, where the redirect was done and the query string left.

Perhaps Fidler (or a protocol sniper) went and see if something is happening that you are not expecting.

Also check that the full page works while working in the name. If this happens then the problem above is almost certainly a problem.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -