Home | History | Annotate | Download | only in libcurl

Lines Matching full:libcurl

23 .TH libcurl-tutorial 3 "October 23, 2017" "libcurl 7.58.0" "libcurl programming"
26 libcurl-tutorial \- libcurl programming tutorial
29 approaches to consider when programming with libcurl. The text will focus
34 that uses libcurl. That would probably be you or someone in your position.
36 source code that you write that is using libcurl for transfers. The program
37 is outside libcurl and libcurl is outside of the program.
48 Your compiler needs to know where the libcurl headers are located. Therefore
54 .IP "Linking the Program with libcurl"
56 a single executable. For that to succeed, you need to link with libcurl and
57 possibly also with other libraries that libcurl itself depends on. Like the
65 libcurl can be built and customized in many ways. One of the things that
68 properly at build-time, libcurl will be built with SSL support. To figure out
69 if an installed libcurl has been built with SSL support enabled, use
78 See also the "Features libcurl Provides" further down.
80 When you write your configure script to detect libcurl and setup variables
82 need in this area. See docs/libcurl/libcurl.m4 file - it includes docs on how
86 The people behind libcurl have put a considerable effort to make libcurl work
89 You program libcurl the same way on all platforms that libcurl runs on. There
92 portable program. libcurl shouldn't stop you from that.
95 The program must initialize some of the libcurl functionality globally. That
101 and it takes one parameter which is a bit pattern that tells libcurl what to
108 a Windows machine, it'll make libcurl initialize the win32 socket
112 should not tell libcurl to do this as well.
115 systems, this will make libcurl initialize the SSL library properly for this
120 libcurl has a default protection mechanism that detects if
122 \fIcurl_easy_perform(3)\fP is called and if that is the case, libcurl runs the
126 When the program no longer uses libcurl, it should call
134 .SH "Features libcurl Provides"
135 It is considered best-practice to determine libcurl features at run-time
138 struct, your program can figure out exactly what the currently running libcurl
142 libcurl first introduced the so called easy interface. All operations in the
146 libcurl also offers another interface that allows multiple simultaneous
151 .SH "Handle the Easy libcurl"
176 Many of the options you set in libcurl are "strings", pointers to data
178 \fIcurl_easy_setopt(3)\fP, libcurl makes its own copy so that they don't need
196 You tell libcurl to pass all data to this function by issuing a function
207 and the function that gets invoked by libcurl. libcurl itself won't touch the
210 libcurl offers its own default internal callback that will take care of the
218 libcurl won't be able to operate on files opened by the program. Thus, if you
226 If you're using libcurl as a win32 DLL, you MUST use the
238 or it may get many kilobytes at once. libcurl delivers as much as possible as
241 passed to it, libcurl will abort the operation and return with an error code.
245 you, you can use the \fICURLOPT_ERRORBUFFER(3)\fP to point libcurl to a buffer
250 you intend to make another transfer. libcurl will then attempt to re-use the
255 finally transferring the file data. libcurl takes care of all that
256 complication for you. Given simply the URL to a file, libcurl will take care
260 libcurl is thread safe but there are a few exceptions. Refer to
265 have set the wrong libcurl option or misunderstood what the libcurl option
279 suspected bugs in libcurl, please include as many details as you possibly can:
281 much as possible of your code that uses libcurl, operating system name and
289 libcurl and how to use it better if you study the appropriate RFC documents
293 libcurl tries to keep a protocol independent approach to most transfers, thus
301 Since we write an application, we most likely want libcurl to get the upload
303 the custom pointer libcurl will pass to our read callback. The read callback
310 of data we can return to libcurl in this call. The 'userp' pointer is the
318 Tell libcurl that we want to upload:
340 to be able to download or upload the data of your choice. libcurl offers
344 itself. libcurl will detect this and use them accordingly. This is written
352 libcurl also provides options to set various passwords. The user name and
354 \fICURLOPT_USERPWD(3)\fP option. The argument passed to libcurl should be a
360 users who need to authenticate themselves to a proxy they use. libcurl offers
369 chapter), as it might contain the password in plain text. libcurl has the
372 libcurl also supports this file for non-FTP protocols such as HTTP. To make
386 at least you could leave it out and have libcurl attempt to do its job
390 To pass the known private key password to libcurl:
398 you can control which way libcurl will (attempt to) use them. The default HTTP
402 At the time of this writing, libcurl can be built to use: Basic, Digest, NTLM,
403 Negotiate (SPNEGO). You can tell libcurl which one to use
414 to make libcurl pick the most secure one out of the types the server/proxy
415 claims to support. This method does however add a round-trip since libcurl
422 with specific types) which allows libcurl to use whatever method it wants.
424 When asking for multiple types, libcurl will pick the available one it
428 We get many questions regarding how to issue HTTP POSTs with libcurl the
430 versions of HTTP POST that libcurl supports.
434 libcurl to post it all to the remote site:
449 Content-Type: header of the post? Well, binary posts prevent libcurl from
451 must tell libcurl the size of the post data. Setting headers in libcurl
453 then passing that list to libcurl.
479 and post a multi-part formpost with the regular libcurl POST support described
481 to libcurl. To make that easier, libcurl provides a MIME API consisting in
531 A deprecated \fIcurl_formadd(3)\fP function is still supported in libcurl.
566 application to handicraft this formpost even more, libcurl allows you to
596 Just setting \fICURLOPT_POSTFIELDS(3)\fP to "" or NULL will *not* stop libcurl
731 For historical and traditional reasons, libcurl has a built-in progress meter
740 callback. The function pointer you pass to libcurl will then be called on
755 argument, the 'clientp' is the pointer you pass to libcurl with
756 \fICURLOPT_PROGRESSDATA(3)\fP. libcurl won't touch it.
758 .SH "libcurl with C++"
761 when interfacing libcurl:
788 libcurl supports SOCKS and HTTP proxies. When a given URL is wanted, libcurl
792 If you're using a SOCKS proxy, you may find that libcurl doesn't quite support
798 libcurl. This happens transparently, and an application may not need to
806 To tell libcurl to use a proxy at a given port number:
819 Tell libcurl what kind of proxy it is with \fICURLOPT_PROXYTYPE(3)\fP (if not,
826 libcurl automatically checks and uses a set of environment variables to know
848 To explicitly disable libcurl's checking for and using the proxy environment
886 Tell libcurl to use proxy tunneling like this:
892 the remote server instead of asking the proxy to do so. libcurl will not
905 libcurl has no means to interpret or evaluate Javascript and thus it doesn't
924 After each single \fIcurl_easy_perform(3)\fP operation, libcurl will keep the
930 host again, will benefit from libcurl's session ID cache that drastically
938 libcurl caches DNS name resolving results, to make lookups of a previously
957 .SH "HTTP Headers Used by libcurl"
958 When you use libcurl to do HTTP requests, it'll pass along a series of headers
971 When doing POST requests, libcurl sets this header to \&"100-continue" to ask
973 of the post. If the POSTed data amount is deemed "small", libcurl will not use
985 libcurl is your friend here too.
1041 when doing a non-GET HTTP operation, libcurl will switch over to "chunked"
1043 libcurl usually switches over to chunked upload automatically if the upload
1049 we support. libcurl speaks HTTP 1.1 by default. Some very old servers don't
1051 you can tell libcurl to use 1.0 instead by doing something like this:
1064 a data-connection must be left to libcurl's own judgement. Also be aware
1065 that libcurl will do its very best to change directory to the target
1067 or similar) you might confuse libcurl and then it might not attempt to
1090 server, no more commands will be issued and libcurl will bail out with an
1095 If you set the \fICURLOPT_HEADER(3)\fP to 1, you will tell libcurl to get
1132 libcurl to read the previous headers to
1137 parser in libcurl. Until the cookie parser is enabled, libcurl will not parse
1148 your Netscape or Mozilla browsers, you can make libcurl use that cookie file
1149 as input. The \fICURLOPT_COOKIEFILE(3)\fP is used for that too, as libcurl
1152 Perhaps the most advanced cookie operation libcurl offers, is saving the
1164 back to haunt you. libcurl offers several different ways to customize how the
1167 libcurl can either connect to the server a second time or tell the server to
1170 libcurl then tells the server to open up a new port and wait for a second
1175 You can prevent libcurl from first trying the EPSV command by setting
1180 or something and only allows connections on a single port. libcurl then
1183 libcurl will use your system's "default IP address". If you want to use a
1185 IP address or even a local network interface name that libcurl will get the IP
1188 When doing the "PORT" approach, libcurl will attempt to use the EPRT and the
1217 Upon sending such a message, libcurl prepends it with the header list
1274 What might be even more useful, is libcurl's ability to separate the headers
1295 The libcurl project takes security seriously. The library is written with
1300 used the right way, you can use libcurl to transfer data pretty safely.
1305 some risks in the ways in which applications commonly use libcurl and
1313 If you use a command line tool (such as curl) that uses libcurl, and you give
1334 Many of the protocols libcurl supports send name and password unencrypted as
1348 URL, not just HTTP. By default libcurl will allow all protocols on redirect
1352 A redirect to a file: URL would cause the libcurl to read (or write) arbitrary
1365 the user running the libcurl application, SCP: or SFTP: URLs could access
1373 libcurl, including servers hidden behind a firewall from the attacker.
1387 server-side libcurl-using application could then use. e.g. the innocuous URL
1402 address and port number for a server local to the app running libcurl but
1407 libcurl will normally handle IPv6 addresses transparently and just as easily
1413 that generally shouldn't be accessed by a server-side libcurl-using
1455 A malicious server could cause libcurl to effectively hang by sending a
1461 A malicious server could cause libcurl to effectively hang by starting to send
1467 A malicious server could cause libcurl to download an infinite amount of data,
1503 problems with libcurl and ask someone for help, everything you reveal in order
1534 designed for using with select(). See the libcurl-multi.3 man page for details
1558 file descriptors or sockets to know when to call libcurl again. This also
1562 with the particular file descriptors libcurl uses for the moment.
1565 action and you then call \fIcurl_multi_perform(3)\fP to allow libcurl to do
1566 what it wants to do. Take note that libcurl does also feature some time-out
1610 libcurl 7.10.3 and later have the ability to switch over to chunked
1614 This happens on Windows machines when libcurl is built and used as a
1625 .BR libcurl-errors "(3), " libcurl-multi "(3), " libcurl-easy "(3) "