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(重要)
目录(?)[+]
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
- Using The libcurl C Interface(重要)
- 文章2:Using The libcurl C Interface(重要)
- Get the IP address of a network interface in C using SIOCGIFADDR
- Testing the User Interface - Using DotNetMock
- Using the SAX Interface of LibXML
- Solr文档学习--Using the Solr Administration User Interface(续)
- Using libcurl from C++
- Using libcurl in VC++
- Using SOAP Interface with the SQL Server Data Services
- Using the Oracle Wait Interface to Troubleshoot I/O Issues
- SAP HANA 5. Using the SAP HANA OData Interface. (helloodata)
- Understanding and Using the SharePoint 2013 REST Interface
- Simple example of using the Java Native Interface(JNI)
- Solr文档学习--Using the Solr Administration User Interface
- Using the C "volatile" Keyword
- Using the DBUS C API
- Using the DBUS C API
- Generate C interface from C++ source code using Clang libtooling
- paip.js input onclick失灵不起作用无反应的解决.txt
- 软工导论 12-13-2 实验前提条件
- Sorting and Searching (1)----bubbleSort
- antlr版本冲突
- libcurl - curl_easy_setopt()(未完,待续)
- Using The libcurl C Interface(重要)
- 文章3:libcurl基本编程概述
- 内部类的使用
- 最重要的三种能力:思考力、行动力、表达力
- 用新浪微博java SDK进行OAuth2验证遇到的一些问题
- 2013年3月22日 札记
- Spring IDE
- Arrays and Strings----1
- curl的使用实例 cpp封装