TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Michal Habalcik
NA
3.5k
2.4m
C# HttpWebRequest timing out from USA IPs, fine in browsers
Apr 11 2018 11:31 AM
I am struggling with web requests to some websites like (mrporter.com or size.co.uk). Outside USA (so no USA IPs), I can make requests just fine. However once I am behind USA IP, requests either time out or end up with "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond" exception. I have tried all kind of headers combinations, still no luck. I need to note, that those websites are opening in browsers just fine.
This is my implementation that works with non-USA ips.
var _request = (HttpWebRequest)WebRequest.Create(
"https://www.mrporter.com"
);
_request.CookieContainer =
new
CookieContainer();
_request.UserAgent =
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"
;
_request.KeepAlive =
true
;
_request.AutomaticDecompression = (DecompressionMethods.GZip | DecompressionMethods.Deflate);
_request.Headers.Add(
"Accept-Encoding"
,
"gzip, deflate"
);
_request.Headers.Add(
"Accept-Language"
,
"en-GB, en-US; q=0.9, en; q=0.8"
);
_request.Headers.Add(
"Upgrade-Insecure-Requests"
,
"1"
);
var _srr =
""
;
using
(var response = _request.GetResponse())
{
var httpWebResponse = response.GetResponseStream();
using
(var sr =
new
StreamReader(httpWebResponse))
{
_srr = sr.ReadToEnd();
}
}
Anybody can help? I seriously wasted hours with it with no result ...
Reply
Answers (
1
)
i want to get data of all selected checked box.
droping a column table in simples codes