Using The libcurl C InterfaceThere'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:
Easy or MultiThe 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 interfaceWhen 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() 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总经常用到的函数,还有一系列其他的有用的函数
All man pages are included in every release archive, in three different formats: man page, HTML and pdf. 所有的说明文档都包含在每个发行版本里,有三种形式:man page,HTML和pdf
|