Using The libcurl C Interface(重要)

来源:互联网 发布:vscode .net core 编辑:程序博客网 时间:2024/05/16 08:04

http://blog.csdn.net/yankai0219/article/details/8159697


文章2:Using The libcurl C Interface(重要)

分类: libcurl 250人阅读 评论(0) 收藏 举报

目录(?)[+]


Using The libcurl C Interface

There's the tutorial to start with, read the tutorial to get a general in-depth grip of what libcurl programming is all about.

有一篇概述文章,阅读 the tutorial可以对于libcurl编程有一个深入的理解。

There are some example C source codes you can check out. They're not all-covering or even very extensive, but they might serve as a source of inspiration to start hacking.

另外,也可以在example C source codes学习libcurl。

Dig into the Symbols In Versions document to learn in which libcurl releases symbols were added or removed.

Windows developers using Microsoft Visual Studio, might enjoy:

  • Andrei Jakab's Using libcurl with SSH support in Visual Studio 2010 [PDF]
  • Rosso Salmanzadeh's Using libcurl in Visual Studio [PDF] guide.

Easy or Multi

The easy interface is a synchronous, efficient, quickly used and... yes, easy interface for file transfers. Numerous applications have been built using this.

The multi interface is the asynchronous brother in the family and it also offers multiple transfers using a single thread and more. Get a grip of how to work with it in the multi interface overview.

easy interface是同步、高效、方便使用的,并且easy interface用于文件传输。大量的应用程序都使用easy interface。

multi interface是异步的,提供了使用单个线程或多线程的多次传输。可以阅读 the multi interface overview来理解multi interface是如何工作的

The Easy interface

When using libcurl you init (libcurl - curl_global_init())your easy-session and get a handle, which you use as input to the following interface functions you use.

You continue by setting all the options you want in the upcoming transfer, most important among them is the URL itself. You might want to set some callbacks as well that will be called from the library when data is available etc.

When all is setup, you tell libcurl to perform the transfer. It will then do the entire operation and won't return until it is done or failed.

After the performance is made, you may get information about the transfer and then you cleanup the easy-session's handle and libcurl is entire off the hook!

在使用libcurl时,首先是初始化你的easy-session(简单对话)并获得一个handle,你可以使用这个handle作为接下来所用的接口函数的输入。

接下来,你设置在upcoming transfer(接下来的传输,实际上就是指:接下来的这次连接)中你想要的选项,这些选项中最重要的就是URL。你也可以设置一些用于数据处理的一些回调函数。

当这些都已经建立以后,你就可以执行这次transfer。它会执行所有操作,知道成功或者失败才会返回值。

 

 

See also the easy interface overview.

curl_easy_init() 
curl_easy_cleanup() 
curl_easy_setopt() 
curl_easy_perform() 
curl_easy_getinfo()

While the above functions are the main functions to use in the easy interface, there is a series of other helpful functions too including:

这些函数时在easy interface总经常用到的函数,还有一系列其他的有用的函数

 

curl_version()returns a pointer to the libcurl version stringcurl_getdate()converts a date string to time_tcurl_formadd()build multipart form-data postscurl_formfree()free a previously built form POSTcurl_slist_append()builds a linked listcurl_slist_free_all()frees a whole curl_slist as made with curl_slist_append()curl_easy_escape()URL encodes a stringcurl_easy_unescape()URL decodes a string

All man pages are included in every release archive, in three different formats: man page, HTML and pdf.

所有的说明文档都包含在每个发行版本里,有三种形式:man page,HTML和pdf





原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 手机丢了找到手机店的人怎么办 在手机店买手机买贵了怎么办 王者荣耀好多没对的东西怎么办 用电脑玩游戏键盘不管用怎么办? 王者荣耀跨系统送皮肤领不到怎么办 电脑使用迅雷时提示缓存过高怎么办 扣扣安全中心动态密码忘记了怎么办 pu管两头固定了中间换截怎么办 自己架设的传奇不能注册帐号怎么办 天堂2第八章读取服务端错误怎么办 苹果手机王者荣耀下了不能玩怎么办 苹果手机摔了一下触屏失灵怎么办 华为机回复出厂设置帐号忘了怎么办 华为手机里突然有个pp助手怎么办 华为手机与电脑连接不上怎么办 买房交了首付贷不了款怎么办 手机买贵了实体店不肯退怎么办 在实体店里手机买贵了怎么办 红米手机开启不了安装系统怎么办? 捡个荣耀8双清后要账号怎么办 荣耀7x升级8.0后耗电快怎么办 手机提示当前为耳机播放模式怎么办 华为手机进水了显示耳机模式怎么办 苹果6s突然变成耳机模式怎么办 华为手机出现耳机标志没声音怎么办 苹果手机微信变成耳机模式怎么办 5s不能用4g网络怎么办 华为麦芒四手机系统乱了好卡怎么办 信翼路由器登录密码忘了怎么办 苹果手机电信4g信号变3g怎么办 苹果7手机4g变3g怎么办 朵唯v3逆客手机不支持计步怎么办 移动卡升级4g后网络不好怎么办 电信办宽带送的手机卡不用了怎么办 移动华为悦盒遥控器丢了怎么办 移动签了两年套餐不想用了怎么办 华为手机隐私空间密码忘记了怎么办 华为的隐私空间密码忘记了怎么办 格力新机没密码开不了怎么办 百度下载谷歌浏览器网页错误怎么办 华为手机进水开不了机怎么办开