Lines Matching +full:multi +full:- +full:config
1 ---
3 SPDX-License-Identifier: curl
4 Title: libcurl-tutorial
7 See-also:
8 - libcurl-easy (3)
9 - libcurl-errors (3)
10 - libcurl-multi (3)
11 - libcurl-url (3)
13 - All
14 ---
18 libcurl-tutorial - libcurl programming tutorial
46 installed them. The 'curl-config'[3] tool can be used to get this information:
48 $ curl-config --cflags
57 command line. To figure out which flags to use, once again the 'curl-config'
60 $ curl-config --libs
66 varies from different libraries and builds is the support for SSL-based
68 properly at build-time, libcurl is built with SSL support. To figure out if an
69 installed libcurl has been built with SSL support enabled, use *curl-config*
73 $ curl-config --feature
86 area. See docs/libcurl/libcurl.m4 file - it includes docs on how to use it.
122 which only does anything on libcurls compiled and built SSL-enabled. On these
143 It is considered best-practice to determine libcurl features at runtime rather
144 than at build-time (if possible of course). By calling
156 transfers in a single thread, the so called multi interface. More about that
228 rare platform-dependent nitpicks. Did you spot it? On some platforms[2],
238 CURLOPT_WRITEFUNCTION(3) if you set CURLOPT_WRITEDATA(3) - or experience
272 # Multi-threading Issues
275 libcurl-thread(3) for more information.
281 does, or the remote server might return non-standard replies that confuse the
302 Getting some in-depth knowledge about the protocols involved is never wrong,
366 them URL encoded, as %XX where XX is a two-digit hexadecimal number.
394 non-FTP protocols such as HTTP. To make curl use this file, use the
425 method is called 'Basic', which is sending the name and password in clear-text
426 in the HTTP request, base64-encoded. This is insecure.
446 claims to support. This method does however add a round-trip since libcurl
482 Content-Type: header of the post? Well, binary posts prevent libcurl from being
490 headers = curl_slist_append(headers, "Content-Type: text/xml");
507 POST operations are required, they do not do multi-part formposts. Multi-part
510 called multi-part because they are built by a chain of parts, each part being
512 fact create and post a multi-part formpost with the regular libcurl POST
517 functions: using those, you can create and fill a multi-part form. Function
518 curl_mime_init(3) creates a multi-part body; you can then append new parts
519 to a multi-part body using curl_mime_addpart(3).
522 curl_mime_data(3), file using curl_mime_filedata(3) and user-defined data
526 curl_mime_headers(3) allows defining the part's headers. When a multi-part
541 curl_mime_name(part, "logotype-image");
555 curl_mime_subparts(3) implements nested multi-parts, this way of
585 CURLFORM_COPYNAME, "logotype-image",
597 Multipart formposts are chains of parts using MIME-style separators and
599 that describe the individual content-type, size etc. To enable your
608 headers = curl_slist_append(headers, "Content-Type: text/xml");
611 CURLFORM_COPYNAME, "logotype-image",
635 Four rules have to be respected in building the multi-part:
637 - The easy handle must be created before building the multi-part.
639 - The multi-part is always created by a call to curl_mime_init(handle).
641 - Each part is created by a call to curl_mime_addpart(multipart).
643 - When complete, the multi-part must be bound to the easy handle using
664 the headers to be automatically released upon destroyed the multi-part, thus
665 saving a clean-up call to curl_slist_free_all(3).
669 CURLFORM_PTRNAME, "logotype-image",
670 CURLFORM_FILECONTENT, "-",
676 curl_mime_name(part, "logotype-image");
677 curl_mime_data_cb(part, (curl_off_t) -1, fread, fseek, NULL, stdin);
680 curl_mime_name(3) always copies the field name. The special filename "-" is
682 source using fread(). The transfer is be chunk-encoded since the data size is
766 For historical and traditional reasons, libcurl has a built-in progress meter
773 For most applications however, the built-in progress meter is useless and what
798 The callbacks CANNOT be non-static class member functions
814 What "proxy" means according to Merriam-Webster: "a person authorized to act
819 access to employees through their proxies. Network clients or user-agents ask
842 curl_easy_setopt(handle, CURLOPT_PROXY, "proxy-host.com:8080");
882 variables, set the proxy name to "" - an empty string - with
887 SSL is for secure point-to-point connections. This involves strong encryption
910 This is however not the only time proxy-tunneling might offer benefits to
914 machine, it suddenly also re-introduces the ability to do non-HTTP
930 ## Proxy Auto-Config
944 - Depending on the JavaScript complexity, write up a script that translates it
947 - Read the JavaScript code and rewrite the same logic in another language.
949 - Implement a JavaScript interpreter; people have successfully used the
952 - Ask your admins to stop this, for a static proxy setup or similar.
956 Re-cycling the same easy handle several times when doing multiple requests is
966 re-connection time.
968 FTP connections that are kept alive save a lot of time, as the command-
969 response round-trips are skipped, and also you do not risk getting blocked
1009 When doing POST requests, libcurl sets this header to "100-continue" to ask
1018 reliable protocol that is widely deployed and has excellent proxy-support.
1043 HTTP-like protocols pass a series of headers to the server when doing the
1050 headers = curl_slist_append(headers, "Hey-server-hey: how are you?");
1051 headers = curl_slist_append(headers, "X-silly-content: yes");
1066 headers = curl_slist_append(headers, "Accept: Agent-007");
1083 ## Enforcing chunked transfer-encoding
1085 By making sure a request uses the custom header "Transfer-Encoding: chunked"
1086 when doing a non-GET HTTP operation, libcurl switches over to "chunked"
1095 getting 1.1-requests and when dealing with stubborn old things like that, you
1102 Not all protocols are HTTP-like, and thus the above may not help you when
1107 here), and you can only use commands that work on the control-connection
1109 data-connection must be left to libcurl's own judgment. Also be aware that
1118 headers = curl_slist_append(headers, "DELE file-to-remove");
1142 are in "HTTP-style", looking like they do in HTTP.
1163 In real-world cases, servers send new cookies to replace existing ones to
1166 Cookies are sent from server to clients with the header Set-Cookie: and
1203 file. We call that the cookie-jar. When you set a filename with
1218 best for all the people behind firewalls, NATs or IP-masquerading setups.
1231 with the CURLOPT_FTPPORT(3) option. If you set it to "-", libcurl uses your
1242 In addition to support HTTP multi-part form fields, the MIME API can be used
1248 multi-part, for example to include another email message or to offer several
1251 To build such a message, you prepare the nth-level multi-part and then include
1252 it as a source to the parent multi-part using function
1254 bound to its parent multi-part, a nth-level multi-part belongs to it and
1257 Email messages data is not supposed to be non-ascii and line length is
1263 use this function (this would over-encode it), but explicitly set the
1295 "Content-Disposition: inline");
1318 Some protocols provide "headers", meta-data separated from the normal
1336 actually true headers, but in this case we pretend they are! ;-)
1342 # The multi Interface
1348 The multi interface, on the other hand, allows your program to transfer
1350 multiple threads. The name might make it seem that the multi interface is for
1351 multi-threaded programs, but the truth is almost the reverse. The multi
1352 interface allows a single-threaded application to perform the same kinds of
1353 multiple, simultaneous transfers that multi-threaded programs can perform. It
1354 allows many of the benefits of multi-threaded transfers without the complexity
1357 To complicate matters somewhat more, there are even two versions of the multi
1359 designed for using with select(). See the libcurl-multi.3 man page for details
1364 of how to use the easy interface. The multi interface is simply a way to make
1366 a "multi stack".
1370 multi handle with curl_multi_init(3) and add all those easy handles to
1371 that multi handle with curl_multi_add_handle(3).
1391 what it wants to do. Take note that libcurl does also feature some time-out
1404 When a transfer within the multi stack has finished, the counter of running
1419 and some data is share automatically when you use the multi interface.
1421 When you add easy handles to a multi handle, these easy handles automatically
1422 share a lot of the data that otherwise would be kept on a per-easy handle
1425 The DNS cache is shared between handles within a multi handle, making
1429 easy handles by using the share interface, see libcurl-share(3).
1431 Some things are never shared automatically, not within multi handles, like for
1439 Transfer-Encoding in cases where HTTP uploads are done with data of an unknown
1450 The curl-config tool is generated at build-time (on Unix-like systems) and