Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6862829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:42:31+00:00 2026-05-27T02:42:31+00:00

When I am using HttpWebRequest and add this: CookieContainer container = new CookieContainer(); request.CookieContainer

  • 0

When I am using HttpWebRequest and add this:

CookieContainer container = new CookieContainer();
request.CookieContainer = container;

it will throw an Operation Timeout exception in

HttpWebResponse response = request.GetResponse() as HttpWebResponse;

If I don’t add the CookieContainer the program runs without errors. Why doesn’t this work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:42:32+00:00Added an answer on May 27, 2026 at 2:42 am

    How are you creating Request object??

    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(args[0]);
                request.CookieContainer = new CookieContainer();
                HttpWebResponse response = (HttpWebResponse) request.GetResponse();
    

    CookieContainer

    Try to set myWebRequest.Timeout =xxx

    • If you are running multiple concurrent requests try setting connections limit

    System.Net.ServicePointManager.DefaultConnectionLimit
    ServicePoint.ConnectionLimit

    Check these links for more information:

    HttpWebRequest "operation has timed out"
    I need help setting .NET HttpWebRequest timeout
    Adjusting HttpWebRequest Connection Timeout in C#

    here are many reasons why GetResponse() might hang. Some are:

    1) You have reached the connection limit on the client ( 2 conns per http/1.1 server, 4 connections per http/1.0 server, or custom limit set on the ServicePoint), and no connection is free to send a request to the server. In other words, you might have 2 requests outstanding (eg: to a 1.1 server) which are taking more than 2 minutes to complete, and then issue another GetResponse() to the same server. The last getresponse() might time out.

    2) You have not closed the response stream of an earlier httpwebresponse. So, even if a connection is free, the request wont be sent.

    3) The server is taking too long to send the response.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been using HttpWebRequest/HttpWebResponse lately and I'm getting encoding problems. HttpWebResponse.CharacterSet doesn't always represent
I am getting this error. When i call the c# WebService using HttpWebRequest .
I need to add new records to my SQL database using C# and php.
I have this function to retreive response cookies in a CookieContainer (this.cookies) private void
I'm using HttpWebRequest to pull down XML, and POST data back to a 'WebService'
I am returning XML data from the Yahoo GeoPlanet web service using HttpWebRequest .
I'm trying to make an SSL call using HTTPWebRequest and its continually failing saying
I am trying to read a remote file using HttpWebRequest in a C# Console
Any ideas why on some links that I try to access using HttpWebRequest I
I have a task to perform an HttpWebRequest using Task<WebResponse>.Factory.FromAsync(req.BeginGetRespone, req.EndGetResponse) which can obviously

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.