curl_setpot record

无营养,只是为了记录

c.getinfo(c.HTTP_CODE)

c.getinfo(c.TOTAL_TIME)

c.getinfo(c.SPEED_DOWNLOAD)

c.getinfo(c.SIZE_DOWNLOAD)

c.getinfo(c.CONTENT_TYPE)

c.getinfo(c.NAMELOOUP_TIME)

c.getinfo(c.REDIRECT_TIME)

c.getinfo(c.REDIRECT_COUNT)

c.getinfo(c.INFO_FILETIME)

c.getinfo(c.PRIMARY_PORT)

c.getinfo(c.LOCAL_IP)

c.getinfo(c.LOCAL_PORT)

c.getinfo(c.EFFECTIVE_URL)



超时时,curl_errno()会返回28

  • 超时
  • curl_setopt($ch, CURLOPT_TIMEOUT, 40);
  • curl_setopt($ch, CURLOPT_TIMEOUT_MS, 40);
  • curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 40);
  • curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, 40);
  • 自动跳转
  • curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); 
  • curl_setopt($ch, CURLOPT_MAXREDIRS, 3); 
  • post
  • curl_setopt($ch, CURLOPT_POST, 1);
  • curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
  • header
  • curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
  • curl_setopt($ch, CURLOPT_REFERER, $ref_url);
  • curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // 指定header
  • cookie
  • curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
  • curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
  • 有时也许会用到https
  • curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  • curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  • 有时也许会用到代理
  • curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
  • curl_setopt($ch, CURLOPT_PROXY, $proxy);

/Library/Python/2.7/site-packages/xapian


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值