• Home
  • Raw
  • Download

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)
12 ---
16 libcurl-tutorial - libcurl programming tutorial
44 installed them. The 'curl-config'[3] tool can be used to get this information:
46 $ curl-config --cflags
55 command line. To figure out which flags to use, once again the 'curl-config'
58 $ curl-config --libs
64 varies from different libraries and builds is the support for SSL-based
66 properly at build-time, libcurl is built with SSL support. To figure out if an
67 installed libcurl has been built with SSL support enabled, use *curl-config*
71 $ curl-config --feature
84 area. See docs/libcurl/libcurl.m4 file - it includes docs on how to use it.
120 which only does anything on libcurls compiled and built SSL-enabled. On these
141 It is considered best-practice to determine libcurl features at runtime rather
142 than at build-time (if possible of course). By calling
154 transfers in a single thread, the so called multi interface. More about that
226 rare platform-dependent nitpicks. Did you spot it? On some platforms[2],
236 CURLOPT_WRITEFUNCTION(3) if you set CURLOPT_WRITEDATA(3) - or experience
270 # Multi-threading Issues
273 libcurl-thread(3) for more information.
279 does, or the remote server might return non-standard replies that confuse the
300 Getting some in-depth knowledge about the protocols involved is never wrong,
364 them URL encoded, as %XX where XX is a two-digit hexadecimal number.
392 non-FTP protocols such as HTTP. To make curl use this file, use the
423 method is called 'Basic', which is sending the name and password in clear-text
424 in the HTTP request, base64-encoded. This is insecure.
444 claims to support. This method does however add a round-trip since libcurl
480 Content-Type: header of the post? Well, binary posts prevent libcurl from being
488 headers = curl_slist_append(headers, "Content-Type: text/xml");
505 POST operations are required, they do not do multi-part formposts. Multi-part
508 called multi-part because they are built by a chain of parts, each part being
510 fact create and post a multi-part formpost with the regular libcurl POST
515 functions: using those, you can create and fill a multi-part form. Function
516 curl_mime_init(3) creates a multi-part body; you can then append new parts
517 to a multi-part body using curl_mime_addpart(3).
520 curl_mime_data(3), file using curl_mime_filedata(3) and user-defined data
524 curl_mime_headers(3) allows defining the part's headers. When a multi-part
539 curl_mime_name(part, "logotype-image");
553 curl_mime_subparts(3) implements nested multi-parts, this way of
583 CURLFORM_COPYNAME, "logotype-image",
595 Multipart formposts are chains of parts using MIME-style separators and
597 that describe the individual content-type, size etc. To enable your
606 headers = curl_slist_append(headers, "Content-Type: text/xml");
609 CURLFORM_COPYNAME, "logotype-image",
633 Four rules have to be respected in building the multi-part:
635 - The easy handle must be created before building the multi-part.
637 - The multi-part is always created by a call to curl_mime_init(handle).
639 - Each part is created by a call to curl_mime_addpart(multipart).
641 - When complete, the multi-part must be bound to the easy handle using
662 the headers to be automatically released upon destroyed the multi-part, thus
663 saving a clean-up call to curl_slist_free_all(3).
667 CURLFORM_PTRNAME, "logotype-image",
668 CURLFORM_FILECONTENT, "-",
674 curl_mime_name(part, "logotype-image");
675 curl_mime_data_cb(part, (curl_off_t) -1, fread, fseek, NULL, stdin);
679 "-" is not supported by curl_mime_filename(3): to read an open file, use
680 a callback source using fread(). The transfer is be chunk-encoded since the
764 For historical and traditional reasons, libcurl has a built-in progress meter
771 For most applications however, the built-in progress meter is useless and what
796 The callbacks CANNOT be non-static class member functions
812 What "proxy" means according to Merriam-Webster: "a person authorized to act
817 access to employees through their proxies. Network clients or user-agents ask
840 curl_easy_setopt(handle, CURLOPT_PROXY, "proxy-host.com:8080");
880 variables, set the proxy name to "" - an empty string - with
885 SSL is for secure point-to-point connections. This involves strong encryption
908 This is however not the only time proxy-tunneling might offer benefits to
912 machine, it suddenly also re-introduces the ability to do non-HTTP
928 ## Proxy Auto-Config
942 - Depending on the JavaScript complexity, write up a script that translates it
945 - Read the JavaScript code and rewrite the same logic in another language.
947 - Implement a JavaScript interpreter; people have successfully used the
950 - Ask your admins to stop this, for a static proxy setup or similar.
954 Re-cycling the same easy handle several times when doing multiple requests is
964 re-connection time.
966 FTP connections that are kept alive save a lot of time, as the command-
967 response round-trips are skipped, and also you do not risk getting blocked
1007 When doing POST requests, libcurl sets this header to "100-continue" to ask
1016 reliable protocol that is widely deployed and has excellent proxy-support.
1039 HTTP-like protocols pass a series of headers to the server when doing the
1046 headers = curl_slist_append(headers, "Hey-server-hey: how are you?");
1047 headers = curl_slist_append(headers, "X-silly-content: yes");
1062 headers = curl_slist_append(headers, "Accept: Agent-007");
1079 ## Enforcing chunked transfer-encoding
1081 By making sure a request uses the custom header "Transfer-Encoding: chunked"
1082 when doing a non-GET HTTP operation, libcurl switches over to "chunked"
1091 getting 1.1-requests and when dealing with stubborn old things like that, you
1098 Not all protocols are HTTP-like, and thus the above may not help you when
1103 here), and you can only use commands that work on the control-connection
1105 data-connection must be left to libcurl's own judgment. Also be aware that
1114 headers = curl_slist_append(headers, "DELE file-to-remove");
1138 are in "HTTP-style", looking like they do in HTTP.
1159 In real-world cases, servers send new cookies to replace existing ones to
1162 Cookies are sent from server to clients with the header Set-Cookie: and
1197 file. We call that the cookie-jar. When you set a filename with
1212 best for all the people behind firewalls, NATs or IP-masquerading setups.
1225 with the CURLOPT_FTPPORT(3) option. If you set it to "-", libcurl uses your
1236 In addition to support HTTP multi-part form fields, the MIME API can be used
1242 multi-part, for example to include another email message or to offer several
1245 To build such a message, you prepare the nth-level multi-part and then include
1246 it as a source to the parent multi-part using function
1248 bound to its parent multi-part, a nth-level multi-part belongs to it and
1251 Email messages data is not supposed to be non-ascii and line length is
1257 use this function (this would over-encode it), but explicitly set the
1289 "Content-Disposition: inline");
1312 Some protocols provide "headers", meta-data separated from the normal
1330 actually true headers, but in this case we pretend they are! ;-)
1336 # The multi Interface
1342 The multi interface, on the other hand, allows your program to transfer
1344 multiple threads. The name might make it seem that the multi interface is for
1345 multi-threaded programs, but the truth is almost the reverse. The multi
1346 interface allows a single-threaded application to perform the same kinds of
1347 multiple, simultaneous transfers that multi-threaded programs can perform. It
1348 allows many of the benefits of multi-threaded transfers without the complexity
1351 To complicate matters somewhat more, there are even two versions of the multi
1353 designed for using with select(). See the libcurl-multi.3 man page for details
1358 of how to use the easy interface. The multi interface is simply a way to make
1360 a "multi stack".
1364 multi handle with curl_multi_init(3) and add all those easy handles to
1365 that multi handle with curl_multi_add_handle(3).
1385 what it wants to do. Take note that libcurl does also feature some time-out
1398 When a transfer within the multi stack has finished, the counter of running
1413 and some data is share automatically when you use the multi interface.
1415 When you add easy handles to a multi handle, these easy handles automatically
1416 share a lot of the data that otherwise would be kept on a per-easy handle
1419 The DNS cache is shared between handles within a multi handle, making
1423 easy handles by using the share interface, see libcurl-share(3).
1425 Some things are never shared automatically, not within multi handles, like for
1433 Transfer-Encoding in cases where HTTP uploads are done with data of an unknown
1444 The curl-config tool is generated at build-time (on Unix-like systems) and