HTTP request C# .NET?

0 like 0 dislike
8 views
Use HTTP request to retrieve the pages of the sites.

Something like this:

...

HttpWebRequest request = WebRequest.Create(Url) as HttpWebRequest;

...

HttpWebResponse response = request.GetResponse() as HttpWebResponse;

...


Sometimes it works, but sometimes it happens so that the page size of a few KB is not loaded... just hanging out, and in the end it all falls on timeout.


Attention! Question:

Why when I turn transparent proxy on localhost all the logs disappear? A simple example of such a proxy — fiddler (aka HTTP sniffer).


If you turn off proxy — these logs immediately returned.

by | 8 views

7 Answers

0 like 0 dislike
See the difference the headers. There is nothing more to say.
by
0 like 0 dislike
Then only last option is that proxy caches and, therefore, no lag. If your proxy is transparent, in fact in direct connection, or through it, there is no difference, there is only a cache.
by
0 like 0 dislike
If you are compiling (in the Studio or not), the lag may be due to fierwall, because it establishes that the new program was breaking on the Internet.
\r
Through the proxy everything is OK, because the proxy program is still the same, and the rules the firewall uses the same as before.
by
0 like 0 dislike
Please don't put such high hopes on fiddler, it is sometimes very randomly. I once after a normal completion of a Fiddler stopped working my program, although Campiglio and re-launched under the Studio without it. All was resolved only on the next start Fiedler.
\r
And drop by timeout normally. Anyway, these eksepsi need to catch and send the request again. Just don't do an infinite loop, you still need to limit the number of connection attempts.
by
0 like 0 dislike
I had a similar problem, after 2 days of analyses was that violated a certain sequence of queries, i.e., before performing a desired Request'was necessary to run the empty POST on a certain page.
by
0 like 0 dislike
Compiler in the release.
Create a rule for Firewall.
Nothing helped.
All all works well with ukljucenim a Fiddler, and still timeoutid without him.
\r
Proxy does not cache, it is essentially a sniffer, it can cache anything.
\r
PS
Checked on 3 computers (work, home, the remote server behind a cordon)
\r
Maybe the problem in the HttpWebRequest?
by
0 like 0 dislike
Definitely not.
This is excluded by the facts of checks in 3 different places.
And never notice the posts.
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
6 answers
0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
0 like 0 dislike
7 answers
110,608 questions
257,186 answers
0 comments
28,851 users