Exemplo n.º 1
0
 /// <summary>
 /// 构造新的HttpClient实例
 /// </summary>
 /// <param name="url">要获取的资源的地址</param>
 /// <param name="context">Cookie及Referer</param>
 /// <param name="keepContext">是否自动在不同的请求间保留Cookie, Referer</param>
 public HttpClient(string url, HttpClientContext context, bool keepContext)
 {
     this.url = url;
     this.context = context;
     this.keepContext = keepContext;
     if (this.context == null)
         this.context = new HttpClientContext();
 }
Exemplo n.º 2
0
 /// <summary>
 /// 构造新的HttpClient实例
 /// </summary>
 /// <param name="url">要获取的资源的地址</param>
 /// <param name="context">Cookie及Referer</param>
 public HttpClient(string url, HttpClientContext context)
     : this(url, context, false)
 {
 }