title: using proxy with HttpWebRequest if/else
body: <p>Im trying to make HttpWebRequest work with proxy based on if statement:</p>
  
  <p>can you spot whats wrong ?</p>
  
  <pre><code>        private HttpWebRequest CreateRequest(Uri url)
      {
          HttpWebRequest request;
           if (Options.DefaultUseproxy != null) 
           {
          request = (HttpWebRequest)WebRequest.Create(url);
          request.Timeout = this.responseTimeout;
          request.UserAgent = this.userAgent;
  
          request.Proxy = new WebProxy(this.Proxy, false);
          return request;
          }
           else
           {
              request = (HttpWebRequest)WebRequest.Create(url);
              request.Timeout = this.responseTimeout;
              request.UserAgent = this.userAgent;
  
  
              return request;
           }
  
  
      }
  </code></pre>