curl_setpot record
2014-03-05 14:45
423 查看
无营养,只是为了记录
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
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
相关文章推荐
- SetWindowHookEx API with WH_JOURNALRECORD. This API fails with access denied (Error 5).
- whatever how, this should be record and be researched later. ---- about how to enable gpio value set in mach_smdk6410.c
- 【Curl (libcurl) 开发 之二】Cocos2dx 之深入(libcurl) 的curl_easy_setopt参数详细介绍!
- [MIDAS basic] BeforeUpdateRecord_SetproviderFlag
- PHP - Manual手册 - XVIII. CURL, Client URL Library Functions客户端URL库函数 - curl_setopt设置cURL传输的选项
- CRecordsetBindObject优化
- curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in
- curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in
- 使用 FireDAC的 TFDConnection, TFDQuery 最初只能显示50条记录,TDateSet.RecordCount总是获得50的解决方法。
- Curl (libcurl) 开发 之二】Cocos2dx 之深入(libcurl) 的curl_easy_setopt参数详细介绍
- 【Curl (libcurl) 开发 之二】Cocos2dx 之深入(libcurl) 的curl_easy_setopt参数详细介绍!
- PHP中curl_setopt参数
- curl_easy_setopt参数详细介绍!
- 【Curl (libcurl) 开发 之二】Cocos2dx 之深入(libcurl) 的curl_easy_setopt参数详细介绍
- 总结PeolpleSoft中BU、SetId、Record Group、TableSet 、TableSet Sharing的关系
- SetCursorPos for Error Record.Field
- ext/curl/.libs/interface.o: undefined reference to symbol 'CRYPTO_set_id_callback'
- [Record] Draw a Cube with Unity3D via Creat an object,get Mesh,set Mesh and Render Mesh
- 源码更新curl后报CRYPTO_set_locking_callback错误 推荐
- [转]php curl 设置host curl_setopt CURLOPT_HTTPHEADER 指定host