title: How to extend length of time for http response
body: <p>Read this but didnt see how to actually extend the time limit for a response:
  <a href="https://devcenter.heroku.com/articles/request-timeout" rel="nofollow">https://devcenter.heroku.com/articles/request-timeout</a></p>
  
  <pre><code> string responseContents = string.Empty;
  
   //get web request to wait 5 mins
  
   HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
  
   byte[] requestBytes = System.Text.Encoding.ASCII.GetBytes(message);
   request.Method = "POST";
   request.ContentType = "text/xml;charset=utf-8";
   request.ContentLength = requestBytes.Length;
  
   using (Stream requestStream = request.GetRequestStream())
   {
       requestStream.Write(requestBytes, 0, requestBytes.Length);
       requestStream.Close();
   }
  
   using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
   {
       using (StreamReader sr = new StreamReader(response.GetResponseStream(), System.Text.Encoding.Default))
       {
           responseContents = sr.ReadToEnd();
       }
   }
  </code></pre>
  
  <p>Problem being, a lot of stuff going on in the server and takes time to return a response, depending on file size.</p>