title: C# Web Request / Server Unavailable Error / HTTP Headers
body: <p>When I run a HTTPWebRequest on a particular URL, it returns 503 (Server Unavailable).  Here is my code:</p>
  
  <pre><code>        webClient.Headers[HttpRequestHeader.UserAgent] = _userAgent;
          webClient.Headers[HttpRequestHeader.AcceptEncoding] = "gzip, deflate";
          webClient.Headers[HttpRequestHeader.Accept] = "Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, */*";
          webClient.Headers[HttpRequestHeader.Cookie] = "searchState=WA";
  
          byte[] firstResponse = webClient.DownloadData(URL);
  </code></pre>
  
  <p>Here is what is sent to the browser when I request the page in IE (according to Fiddler):</p>
  
  <pre><code>GET http://www.[url].com/[url] HTTP/1.1
  Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, */*
  Accept-Language: en-US
  User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; Media Center PC 6.0; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0E)
  Accept-Encoding: gzip, deflate
  Proxy-Connection: Keep-Alive
  Host: www.[url].com
  Cookie: searchState=WA
  </code></pre>
  
  <p>Is there anything else I need to add to my code?  Many thanks.</p>
  
  <p>EDIT: here are the response headers:</p>
  
  <pre><code>HTTP/1.0 200 OK
  Date: Fri, 21 Jan 2011 04:02:33 GMT
  Server: Apache-Coyote/1.1
  Cache-Control: no-cache
  Pragma: no-cache
  Expires: Thu, 01 Jan 1970 00:00:00 GMT
  Content-Type: text/html;charset=UTF-8
  Set-Cookie: JSESSIONID=39EFAAA14B9C6E0384631007966B7CB8; Path=/
  Set-Cookie: searchState=WA; Expires=Sun, 20-Feb-2011 04:02:33 GMT; Path=/
  Set-Cookie: search_tab=R; Path=/
  X-Cache: MISS from 200.157.247.7
  Proxy-Connection: close
  Content-Length: 26987
  </code></pre>