Artifactspublic-v0

curl

master
ply4 git calls33 ms311 KiB3 cachedprotocol v2
1434 lines59 KiBRaw

Frequently Asked Questions

Philosophy

What is curl?

curl is the name of the project. The name is a play on Client for URLs, originally with URL spelled in uppercase to make it obvious it deals with URLs. The fact it can also be read as see URL also helped, it works as an abbreviation for Client URL Request Library or why not the recursive version: curl URL Request Library.

The curl project produces two products:

libcurl

A client-side URL transfer library, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, MQTTS, POP3, POP3S, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET, TFTP, WS and WSS.

libcurl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, Kerberos, SPNEGO, HTTP form based upload, proxies, cookies, user+password authentication, file transfer resume, http proxy tunneling and more.

libcurl is highly portable, it builds and works identically on numerous platforms. The internals document lists more than 110 operating systems and 28 CPU architectures on which curl has been reported to run.

libcurl is free, thread-safe, IPv6 compatible, feature-rich, well supported and fast.

curl

A command line tool for getting or sending data using URL syntax.

Since curl uses libcurl, curl supports the same wide range of common Internet protocols that libcurl does.

We pronounce curl with an initial k sound. It rhymes with words like girl and earl. This is a short WAV file to help you.

There are numerous sub-projects and related projects that also use the word curl in the project names in various combinations, but you should take notice that this FAQ is directed at the command-line tool named curl (and libcurl the library), and may therefore not be valid for other curl-related projects. (There is however a small section for the PHP/CURL in this FAQ.)

What is libcurl?

libcurl is a reliable and portable library for doing Internet data transfers using one or more of its supported Internet protocols.

You can use libcurl freely in your application, be it open source, commercial or closed-source.

libcurl is most probably the most portable, most powerful and most often used C-based multi-platform file transfer library on this planet - be it open source or commercial.

What is curl not?

curl is not a Wget clone. That is a common misconception. Never, during curl's development, have we intended curl to replace Wget or compete on its market. curl is targeted at single-shot file transfers.

curl is not a website mirroring program. If you want to use curl to mirror something: fine, go ahead and write a script that wraps around curl or use libcurl to make it reality.

curl is not an FTP site mirroring program. Sure, get and send FTP with curl but if you want systematic and sequential behavior you should write a script (or write a new program that interfaces libcurl) and do it.

curl is not a PHP tool, even though it works perfectly well when used from or with PHP (when using the PHP/CURL module).

curl is not a program for a single operating system. curl exists, compiles, builds and runs under a wide range of operating systems, including all modern Unixes (and a bunch of older ones too), Windows, Amiga, OS/2, macOS, QNX etc.

When would you make curl do ... ?

We love suggestions of what to change in order to make curl and libcurl better. We do however believe in a few rules when it comes to the future of curl:

curl the command line tool is to remain a non-graphical command line tool. If you want GUIs or fancy scripting capabilities, you should look for another tool that uses libcurl.

We do not add things to curl that other small and available tools already do well at the side. curl's output can be piped into another program or redirected to another file for the next program to interpret.

We focus on protocol related issues and improvements. If you want to do more with the supported protocols than curl currently does, chances are good we would agree. If you want to add more protocols, we may agree.

If you want someone else to do all the work while you wait for us to implement it for you, that is not a friendly attitude. We spend a considerable time already on maintaining and developing curl. In order to get more out of us, you should consider trading in some of your time and effort in return. Go to the GitHub repository, fork the project, and create pull requests with your proposed changes.

If you write the code, chances are better that it gets into curl faster.

Who makes curl?

curl and libcurl are not made by any single individual. Daniel Stenberg is project leader and main developer, but other persons' submissions are important and crucial. Anyone can contribute and post their changes and improvements and have them inserted in the main sources (of course on the condition that developers agree that the fixes are good).

The full list of all contributors is found in the docs/THANKS file.

curl is developed by a community, with Daniel at the wheel.

What do you get for making curl?

Project curl is entirely free and open. We do this voluntarily, mostly in our spare time. Companies may pay individual developers to work on curl. This is not controlled by nor supervised in any way by the curl project.

We get help from companies. Haxx provides website, bandwidth, mailing lists etc, GitHub hosts the primary git repository and other services like the bug tracker. Also again, some companies have sponsored certain parts of the development in the past and I hope some continue to do so in the future.

If you want to support our project, consider a donation or a banner-program or even better: by helping us with coding, documenting or testing etc.

What about CURL from curl.com?

During the summer of 2001, curl.com was busy advertising their client-side programming language for the web, named CURL.

We are in no way associated with curl.com or their CURL programming language.

Our project name curl has been in effective use since 1998. We were not the first computer related project to use the name curl and do not claim any rights to the name.

We recognize that we are living in parallel with curl.com and wish them every success.

I have a problem, who do I mail?

Please do not mail any single individual unless you really need to. Keep curl-related questions on a suitable mailing list. All available mailing lists are listed online.

Keeping curl-related questions and discussions on mailing lists allows others to join in and help, to share their ideas, to contribute their suggestions and to spread their wisdom. Keeping discussions on public mailing lists also allows for others to learn from this (both current and future users thanks to the web based archives of the mailing lists), thus saving us from having to repeat ourselves even more. Thanks for respecting this.

If you have found or suspect a security problem in curl or libcurl, submit all the details to us. We keep the issue private while we investigate, confirm it, work and validate a fix and agree on a time schedule for publication etc. That way we produce a fix in a timely manner before the flaw is announced to the world, reducing the impact the problem risks having on existing users.

Security issues can also be taken to the curl security team by emailing security at curl.se (closed list of receivers, mails are not disclosed).

Where do I buy commercial support for curl?

curl is fully open source. It means you can hire any skilled engineer to fix your curl-related problems.

We list available alternatives.

How many are using curl?

It is impossible to tell.

We do not know how many users that knowingly have installed and use curl.

We do not know how many users that use curl without knowing that they are in fact using it.

We do not know how many users that downloaded or installed curl and then never use it.

In 2025, we estimate that curl runs in roughly thirty billion installations world wide.

Why do you not update ca-bundle.crt

In the curl project we have decided not to attempt to keep this file updated (or even present) since deciding what to add to a CA cert bundle is an undertaking we have not been ready to accept, and the one we can get from Mozilla is perfectly fine so there is no need to duplicate that work.

Today, with many services performed over HTTPS, every operating system should come with a default CA cert bundle that can be deemed somewhat trustworthy and that collection (if reasonably updated) should be deemed to be a lot better than a private curl version.

If you want the most recent collection of CA certs that Mozilla Firefox uses, we recommend using our online CA certificate service setup for this purpose.

I have a problem, who can I chat with?

There is a bunch of friendly people hanging out in the #curl channel on the IRC network libera.chat. If you are polite and nice, chances are good that you can get -- or provide -- help instantly.

curl's ECCN number?

The US government restricts exports of software that contains or uses cryptography. When doing so, the Export Control Classification Number (ECCN) is used to identify the level of export control etc.

Apache Software Foundation has a good explanation of ECCN.

We believe curl's number might be ECCN 5D002, another possibility is 5D992. It seems necessary to write them (the authority that administers ECCN numbers), asking to confirm.

Comprehensible explanations of the meaning of such numbers and how to obtain them (resp.) are here and here.

An incomprehensible description of the two numbers above is available on bis.doc.gov

How do I submit my patch?

We strongly encourage you to submit changes and improvements directly as pull requests on GitHub.

If you cannot or choose not to engage with GitHub, send your patch to the curl-library mailing list. We are many subscribers there and there are lots of people who can review patches, comment on them and receive them properly.

Many more details are found in the contribute and internals documents.

How do I port libcurl to my OS?

Here's a rough step-by-step:

  1. copy a suitable lib/config-*.h file as a start to lib/config-[youros].h
  2. edit lib/config-[youros].h to match your OS and setup
  3. edit lib/curl_setup.h to include config-[youros].h when your OS is detected by the preprocessor, in the style others already exist
  4. compile lib/*.c and make them into a library

Install

configure fails when using static libraries

You may find that configure fails to properly detect the entire dependency chain of libraries when you provide static versions of the libraries that configure checks for.

The reason why static libraries are much harder to deal with is that for them we do not get any help but the script itself must know or check what more libraries that are needed (with shared libraries, that dependency chain is handled automatically). This is an error-prone process and one that also tends to vary over time depending on the release versions of the involved components and may also differ between operating systems.

For that reason, configure does few attempts to actually figure this out and you are instead encouraged to set LIBS and LDFLAGS accordingly when you invoke configure, and point out the needed libraries and set the necessary flags yourself.

Does curl work with other SSL libraries?

curl has been written to use a generic SSL function layer internally, and that SSL functionality can then be provided by one out of many different SSL backends.

curl can be built to use one of the following SSL alternatives: AWS-LC, BoringSSL, GnuTLS, LibreSSL, OpenSSL, mbedTLS, Rustls, Schannel (native Windows), or wolfSSL. They all have their pros and cons, and we maintain a TLS library comparison.

How do I upgrade curl.exe in Windows?

The curl tool that is shipped as an integrated component of Windows 10 and Windows 11 is managed by Microsoft. If you were to delete the file or replace it with a newer version downloaded from the curl website, then Windows Update ceases to work on your system.

There is no way to independently force an upgrade of the curl.exe that is part of Windows other than through the regular Windows update process. There is also nothing the curl project itself can do about this, since this is managed and controlled entirely by Microsoft as owners of the operating system.

You can always download and install the latest version of curl for Windows into a separate location.

Does curl support SOCKS (RFC 1928) ?

Yes, SOCKS 4 and 5 are supported.

Usage

curl: (1) SSL is disabled, https: not supported

If you get this output when trying to get anything from an HTTPS server, it means that the instance of curl/libcurl that you are using was built without support for this protocol.

This could have happened if the configure script that was run at build time could not find all libs and include files curl requires for SSL to work. If the configure script fails to find them, curl is built without SSL support.

To get HTTPS support into a curl that was previously built but that reports that HTTPS is not supported, you should dig through the document and logs and check out why the configure script does not find the SSL libs and/or include files.

How do I tell curl to resume a transfer?

curl supports resumed HTTP, FTP and SFTP downloads as well as resumed FTP and SFTP uploads. Try the -C option.

Why does my posting using -F not work?

You cannot arbitrarily use -F or -d, the choice between -F or -d depends on the HTTP operation you need curl to do and what the web server that receives your post expects.

If the form you are trying to submit uses the type 'multipart/form-data', then and only then you must use the -F type. In all the most common cases, you should use -d which then causes a posting with the type application/x-www-form-urlencoded.

This is described in some detail in the Manual and The Art Of HTTP Scripting documents, and if you do not understand it the first time, read it again before you post questions about this to the mailing list. Also, try reading through the mailing list archives for old postings and questions regarding this.

How do I tell curl to run custom FTP commands?

You can tell curl to perform optional commands both before and/or after a file transfer. Study the -Q/--quote option.

Since curl is used for file transfers, you do not normally use curl to perform FTP commands without transferring anything. Therefore you must always specify a URL to transfer to/from even when doing custom FTP commands, or use -I which implies the no body option sent to libcurl.

How can I disable the Accept: header?

You can change this and all internally generated headers by adding a replacement with the -H/--header option. By adding a header with empty contents you safely disable that one. Use -H Accept: to disable that specific header.

Does curl support ASP, XML, XHTML or HTML version Y?

To curl, all contents are alike. It does not matter how the page was generated. It may be ASP, PHP, Perl, shell-script, SSI or plain HTML files. There is no difference to curl and it does not even know what kind of language that generated the page.

See also the separate question about JavaScript.

Can I use curl to delete/rename a file through FTP?

Yes. You specify custom FTP commands with -Q/--quote.

One example would be to delete a file after you have downloaded it:

curl -O ftp://example.com/coolfile -Q '-DELE coolfile'

or rename a file after upload:

curl -T infile ftp://example.com/dir/ -Q "-RNFR infile" -Q "-RNTO newname"

How do I tell curl to follow HTTP redirects?

curl does not follow so-called redirects by default. The Location: header that informs the client about this is only interpreted if you are using the -L/--location option. As in:

curl -L https://example.com

Not all redirects are HTTP ones. See Redirects work in browser but not with curl

How do I use curl in my favorite programming language?

Many programming languages have interfaces and bindings that allow you to use curl without having to use the command line tool. If you are fluent in such a language, you may prefer to use one of these interfaces instead.

Find out more about which languages that support curl directly, and how to install and use them, in the libcurl section of the curl website.

All the various bindings to libcurl are made by other projects and people, outside of the curl project. The curl project itself only produces libcurl with its plain C API. If you do not find anywhere else to ask you can ask about bindings on the curl-library list too, but be prepared that people on that list may not know anything about bindings.

In December 2025 there were around 60 different interfaces available for almost any language you can imagine.

What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP?

curl adheres to the HTTP spec, which means you can play with any protocol that is built on top of HTTP. Protocols such as SOAP, WebDAV and XML-RPC are all such ones. You can use -X to set custom requests and -H to set custom headers (or replace internally generated ones).

Using libcurl of course also works and you would use the proper library options to do the same.

How do I POST with a different Content-Type?

You can always replace the internally generated headers with -H/--header. To make a simple HTTP POST with text/xml as content-type, do something like:

curl -d "datatopost" -H "Content-Type: text/xml" [URL]

Why do FTP-specific features over HTTP proxy fail?

Because when you use an HTTP proxy, the protocol spoken on the network is HTTP, even if you specify an FTP URL. This effectively means that you normally cannot use FTP-specific features such as FTP upload and FTP quote etc.

There is one exception to this rule, and that is if you can tunnel through the given HTTP proxy. Proxy tunneling is enabled with a special option (-p) and is generally not available as proxy admins usually disable tunneling to ports other than 443 (which is used for HTTPS access through proxies).

Why do my single/double quotes fail?

To specify a command line option that includes spaces, you might need to put the entire option within quotes. Like in:

curl -d " with spaces " example.com

or perhaps

curl -d ' with spaces ' example.com

Exactly what kind of quotes and how to do this is entirely up to the shell or command line interpreter that you are using. For most Unix shells, you can more or less pick either single (') or double (") quotes. For Windows/DOS command prompts you must use double (") quotes, and if the option string contains inner double quotes you can escape them with a backslash.

For Windows PowerShell the arguments are not always passed on as expected because curl is not a PowerShell script. You may or may not be able to use single quotes. To escape inner double quotes seems to require a backslash-backtick escape sequence and the outer quotes as double quotes.

Please study the documentation for your particular environment. Examples in the curl docs use a mix of both of these as shown above. You must adjust them to work in your environment.

Remember that curl works and runs on more operating systems than most single individuals have ever tried.

Does curl support JavaScript or PAC (automated proxy config)?

Many webpages do stuff using embedded JavaScript. curl and libcurl have no built-in support for that, so it is treated like any other contents.

.pac files are a Netscape invention and are sometimes used by organizations to allow them to differentiate which proxies to use. The .pac contents is a JavaScript program that gets invoked by the browser and that returns the name of the proxy to connect to. Since curl does not support JavaScript, it cannot support .pac proxy configuration either.

Some workarounds usually suggested to overcome this JavaScript dependency:

Depending on the JavaScript complexity, write up a script that translates it to another language and execute that.

Read the JavaScript code and rewrite the same logic in another language.

Implement a JavaScript interpreter, people have successfully used the Mozilla JavaScript engine in the past.

Ask your admins to stop this, for a static proxy setup or similar.

Can I do recursive fetches with curl?

No. curl itself has no code that performs recursive operations, such as those performed by Wget and similar tools.

There exists curl using scripts with that functionality, and you can write programs based on libcurl to do it, but the command line tool curl itself cannot.

What certificates do I need when I use SSL?

There are three different kinds of certificates to keep track of when we talk about using SSL-based protocols (HTTPS or FTPS) using curl or libcurl.

Client certificate

The server you communicate with may require that you can provide this in order to prove that you actually are who you claim to be. If the server does not require this, you do not need a client certificate.

A client certificate is always used together with a private key, and the private key has a passphrase that protects it.

Server certificate

The server you communicate with has a server certificate. You can and should verify this certificate to make sure that you are truly talking to the real server and not a server impersonating it.

Servers often also provide an intermediate certificate. It acts as a bridge between a website's SSL certificate and a Certificate Authority's (CA) root certificate, creating a "chain of trust".

Certificate Authority Certificate ("CA cert")

You often have several CA certs in a CA cert bundle that can be used to verify a server certificate that was signed by one of the authorities in the bundle. curl does not come with a CA cert bundle but most curl installs provide one. You can also override the default.

Server certificate verification is enabled by default in curl and libcurl. Server certificates that are self-signed or otherwise signed by a CA that you do not have a CA cert for, cannot be verified. If the verification during a connect fails, you are refused access. You then might have to explicitly disable the verification to connect to the server.

How do I list the root directory of an FTP server?

There are two ways. The way defined in the RFC is to use an encoded slash in the first path part. List the /tmp directory like this:

curl ftp://ftp.example.com/%2ftmp/

The second way is non-standard but more readable; start the path section of the URL with a slash:

curl ftp://ftp.example.com//tmp/

Can I use curl to send a POST/PUT and not wait for a response?

No.

You can easily write your own program using libcurl to do such stunts.

How do I get HTTP from a host using a specific IP address?

For example, you may be trying out a website installation that is not yet in the DNS. Or you have a site using multiple IP addresses for a given host name and you want to address a specific one out of the set.

Set a custom Host: header that identifies the server name you want to reach but use the target IP address in the URL:

curl --header "Host: www.example.com" https://somewhere.example/

You can also opt to add faked hostname entries to curl with the --resolve option. That has the added benefit to make things like redirects also work properly. The above operation would instead be done as:

curl --resolve www.example.com:80:127.0.0.1 https://www.example.com/

How to SFTP from my user's home directory?

Contrary to how FTP works, SFTP and SCP URLs specify the exact directory to work with. It means that if you do not specify that you want the user's home directory, you get the actual root directory.

To specify a file in your user's home directory, you need to use the correct URL syntax which for SFTP might look similar to:

curl -O -u user:password sftp://example.com/~/file.txt

and for SCP it is a different protocol prefix:

curl -O -u user:password scp://example.com/~/file.txt

Protocol xxx not supported or disabled in libcurl

When passing on a URL to curl to use, it may respond that the particular protocol is not supported or disabled. The particular way this error message is phrased is because curl does not make a distinction internally of whether a particular protocol is not supported (i.e. never got any code added that knows how to speak that protocol) or if it was explicitly disabled. curl can be built to only support a given set of protocols, and the rest would then be disabled or not supported.

Note that this error also occurs if you pass a wrongly spelled protocol part as in htpts://example.com or as in the less evident case if you prefix the protocol part with a space as in " https://example.com/".

curl -X gives me HTTP problems

In normal circumstances, -X should hardly ever be used.

By default you use curl without explicitly saying which request method to use when the URL identifies an HTTP transfer. If you pass in a URL like curl https://example.com it uses GET. If you use -d or -F, curl uses POST, -I causes a HEAD and -T makes it a PUT.

If for whatever reason you are not happy with these default choices that curl does for you, you can override those request methods by specifying -X [WHATEVER]. This way you can for example send a DELETE by doing curl -X DELETE [URL].

It is thus pointless to do curl -XGET [URL] as GET would be used anyway. In the same vein it is pointless to do curl -X POST -d data [URL]. You can make a fun and somewhat rare request that sends a request-body in a GET request with something like curl -X GET -d data [URL].

Note that -X does not actually change curl's behavior as it only modifies the actual string sent in the request, but that may of course trigger a different set of events.

Accordingly, by using -XPOST on a command line that for example would follow a 303 redirect, you effectively prevent curl from behaving correctly. Be aware.

Why is no LOGOUT or QUIT sent when the login fails?

When curl fails to log in to an IMAP, POP3 or SMTP server, for example because the server rejects the username or password, it closes the connection without first sending the disconnect command of the protocol (LOGOUT for IMAP, QUIT for POP3 and SMTP).

libcurl handles authentication as part of setting up the connection, and a connection that fails during setup is closed directly. Servers need to cope with clients that disconnect without a goodbye anyway, so this is expected and accepted behavior.

Running

Why do I get problems when I use & or % in the URL?

In general Unix shells, the & symbol is treated specially and when used, it runs the specified command in the background. To safely send the & as a part of a URL, you should quote the entire URL by using single (') or double (") quotes around it. Similar problems can also occur on some shells with other characters, including ?*!$~(){}<>|;`. When in doubt, quote the URL.

An example that would invoke a remote CGI that uses &-symbols could be:

curl 'https://www.example.com/cgi-bin/query?text=yes&q=curl'

In Windows, the standard DOS shell treats the percent sign specially and you need to use TWO percent signs for each single one you want to use in the URL.

If you want a literal percent sign to be part of the data you pass in a POST using -d/--data you must encode it as %25 (which then also needs the percent sign doubled on Windows machines).

How can I use {, }, [ or ] to specify multiple URLs?

Because those letters have a special meaning to the shell, to be used in a URL specified to curl you must quote them.

An example that downloads two URLs (sequentially) would be:

curl '{curl,www}.haxx.se'

To be able to use those characters as actual parts of the URL (without using them for the curl URL globbing system), use the -g/--globoff option:

curl -g 'www.example.com/weirdname[].html'

Why do I get downloaded data even though the webpage does not exist?

curl asks remote servers for the page you specify. If the page does not exist at the server, the HTTP protocol defines how the server should respond and that means that headers and a page get returned. That is how HTTP works.

By using the --fail option you can tell curl explicitly to not get any data if the HTTP return code does not say success.

Why do I get return code XXX from an HTTP server?

RFC 2616 clearly explains the return codes. This is a short transcript. Go read the RFC for exact details:

400 Bad Request

The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.

401 Unauthorized

The request requires user authentication.

403 Forbidden

The server understood the request, but is refusing to fulfill it. Authorization cannot help and the request SHOULD NOT be repeated.

404 Not Found

The server has not found anything matching the Request-URI. No indication is given as to whether the condition is temporary or permanent.

405 Method Not Allowed

The method specified in the Request-Line is not allowed for the resource identified by the Request-URI. The response MUST include an Allow: header containing a list of valid methods for the requested resource.

301 Moved Permanently

If you get this return code and an HTML output similar to this:

<H1>Moved Permanently</H1> The document has moved <A
HREF="https://same_url_now_with_a_trailing_slash.example/">here</A>.

it might be because you requested a directory URL but without the trailing slash. Try the same operation again with the trailing URL, or use the -L/--location option to follow the redirection.

Can you tell me what error code 142 means?

All curl error codes are described at the end of the man page, in the section called EXIT CODES.

Error codes that are larger than the highest documented error code means that curl has exited due to a crash. This is a serious error, and we appreciate a detailed bug report from you that describes how we could go ahead and repeat this.

How do I keep usernames and passwords secret in curl command lines?

This problem has two sides:

The first part is to avoid having clear-text passwords in the command line so that they do not appear in ps outputs and similar. That is easily avoided by using the -K option to tell curl to read parameters from a file or stdin to which you can pass the secret info. curl itself also attempts to hide the given password by blanking out the option - this does not work on all platforms.

To keep the passwords in your account secret from the rest of the world is not a task that curl addresses. You could of course encrypt them somehow to at least hide them from being read by human eyes, but that is not what anyone would call security.

Also note that regular HTTP (using Basic authentication) and FTP passwords are sent as cleartext across the network. All it takes for anyone to fetch them is to listen on the network. Eavesdropping is easy. Use more secure authentication methods (like Digest or Negotiate) or consider the SSL-based alternatives HTTPS and FTPS.

I found a bug

It is not a bug if the behavior is documented. Read the docs first. Especially check out the KNOWN_BUGS file, it may be a documented bug.

If it is a problem with a binary you have downloaded or a package for your particular platform, try contacting the person who built the package/archive you have.

If there is a bug, read the BUGS document first. Then report it as described in there.

My HTTP request using HEAD, PUT or DELETE does not work

Many web servers allow or demand that the administrator configures the server properly for these requests to work on the web server.

Some servers seem to support HEAD only on certain kinds of URLs.

To fully grasp this, try the documentation for the particular server software you are trying to interact with. This is not anything curl can do anything about.

Why do my HTTP range requests return the full document?

Because the range may not be supported by the server, or the server may choose to ignore it and return the full document anyway.

Why do I get "certificate verify failed" ?

When you invoke curl and get an error 60 error back it means that curl could not verify that the server's certificate was good. curl verifies the certificate using the CA cert bundle and verifying for which names the certificate has been granted.

To completely disable the certificate verification, use -k. This does however enable man-in-the-middle attacks and makes the transfer insecure. We strongly advise against doing this for more than experiments.

If you get this failure with a CA cert bundle installed and used, the server's certificate might not be signed by one of the certificate authorities in your CA store. It might for example be self-signed. You then correct this problem by obtaining a valid CA cert for the server. Or again, decrease the security by disabling this check.

At times, you find that the verification works in your favorite browser but fails in curl. When this happens, the reason is usually that the server sends an incomplete cert chain. The server is mandated to send all intermediate certificates but does not. This typically works with browsers anyway since they A) cache such certs and B) supports AIA which downloads such missing certificates on demand. This is a bad server configuration. A good way to figure out if this is the case it to use the SSL Labs server test and check the certificate chain.

Details are also in the SSL certificates document.

Why is curl -R on Windows one hour off?

Since curl 7.53.0 this issue should be fixed as long as curl was built with any modern compiler that allows for a 64-bit curl_off_t type. For older compilers or prior curl versions it may set a time that appears one hour off. This happens due to a flaw in how Windows stores and uses file modification times and it is not easily worked around. For more details read this.

Redirects work in browser but not with curl

curl supports HTTP redirects well (see a previous question above). Browsers generally support at least two other ways to perform redirects that curl does not:

Meta tags. You can write an HTML tag that causes the browser to redirect to another given URL after a certain time.

JavaScript. You can write a JavaScript program embedded in an HTML page that redirects the browser to another given URL.

There is no way to make curl follow these redirects. You must either manually figure out what the page is set to do, or write a script that parses the results and fetches the new URL.

FTPS does not work

curl supports FTPS (sometimes known as FTP-SSL) both implicit and explicit mode.

When a URL is used that starts with ftps://, curl assumes implicit SSL on the control connection and therefore immediately connects and tries to speak SSL. ftps:// connections default to port 990.

To use explicit FTPS, you use an ftp:// URL and the --ssl-reqd option (or one of its related flavors). This is the most common method, and the one mandated by RFC 4217. This kind of connection then of course uses the standard FTP port 21 by default.

My HTTP POST or PUT requests are slow

libcurl makes all POST and PUT requests (except for requests with a small request body) use the Expect: 100-continue header. This header allows the server to deny the operation early so that libcurl can bail out before having to send any data. This is useful in authentication cases and others.

Many servers do not implement the Expect: stuff properly and if the server does not respond (positively) within 1 second libcurl continues and sends off the data anyway.

You can disable libcurl's use of the Expect: header the same way you disable any header, using -H / CURLOPT_HTTPHEADER, or by forcing it to use HTTP 1.0.

Non-functional connect timeouts

In most Windows setups having a timeout longer than 21 seconds makes no difference, as it only sends 3 TCP SYN packets and no more. The second packet sent three seconds after the first and the third six seconds after the second. No more than three packets are sent, no matter how long the timeout is set.

See Windows option TcpMaxConnectRetransmissions for more.

Also, even on non-Windows systems there may run a firewall or anti-virus software or similar that accepts the connection but does not actually do anything else. This makes (lib)curl to consider the connection connected and thus the connect timeout does not trigger.

file:// URLs containing drive letters (Windows, NetWare)

When using curl to try to download a local file, one might use a URL in this format:

file://D:/blah.txt

you find that even if D:\blah.txt does exist, curl returns a 'file not found' error.

According to RFC 1738, file:// URLs must contain a host component, but it is ignored by most implementations. In the above example, D: is treated as the host component, and is taken away. Thus, curl tries to open /blah.txt. If your system is installed to drive C:, that resolves to C:\blah.txt, and if that does not exist you get the not found error.

To fix this problem, use file:// URLs with three leading slashes:

file:///D:/blah.txt

Alternatively, if it makes more sense, specify localhost as the host component:

file://localhost/D:/blah.txt

In either case, curl should now be looking for the correct file.

Why does not curl return an error when the network cable is unplugged?

Unplugging a cable is not an error situation. The TCP/IP protocol stack was designed to be fault tolerant, so even though there may be a physical break somewhere the connection should not be affected, but possibly delayed. Eventually, the physical break gets fixed or the data re-routed around the physical problem through another path.

In such cases, the TCP/IP stack is responsible for detecting when the network connection is irrevocably lost. Since with some protocols it is perfectly legal for the client to wait indefinitely for data, the stack may never report a problem, and even when it does, it can take up to 20 minutes for it to detect an issue. The curl option --keepalive-time enables keep-alive support in the TCP/IP stack which makes it periodically probe the connection to make sure it is still available to send data. That should reliably detect any TCP/IP network failure.

TCP keep alive does not detect the network going down before the TCP/IP connection is established (e.g. during a DNS lookup) or using protocols that do not use TCP. To handle those situations, curl offers a number of timeouts on its own. --speed-limit/--speed-time aborts if the data transfer rate falls too low, and --connect-timeout and --max-time can be used to put an overall timeout on the connection phase or the entire transfer.

A libcurl-using application running in a known physical environment (e.g. an embedded device with only a single network connection) may want to act immediately if its lone network connection goes down. That can be achieved by having the application monitor the network connection on its own using an OS-specific mechanism, then signaling libcurl to abort.

curl does not return error for HTTP non-200 responses

Correct. Unless you use -f (--fail) or --fail-with-body.

When doing HTTP transfers, curl performs exactly what you are asking it to do and if successful it does not return an error. You can use curl to test your web server's "file not found" page (that gets 404 back), you can use it to check your authentication protected webpages (that gets a 401 back) and so on.

The specific HTTP response code does not constitute a problem or error for curl. It sends and delivers HTTP as you asked and if that worked, everything is fine and dandy. The response code is generally providing more higher level error information that curl does not care about. The error was not in the HTTP transfer.

If you want your command line to treat error codes in the 400 and up range as errors and thus return a non-zero value and possibly show an error message, curl has a dedicated option for that: -f (CURLOPT_FAILONERROR in libcurl speak).

You can also use the -w option and the variable %{response_code} to extract the exact response code that was returned in the response.

libcurl

Is libcurl thread-safe?

Yes.

We have written the libcurl code specifically adjusted for multi-threaded programs. libcurl uses thread-safe functions instead of non-safe ones if your system has such. Note that you must never share the same handle in multiple threads.

There may be some exceptions to thread-safety depending on how libcurl was built. Please review the guidelines for thread safety to learn more.

How can I receive all data into a large memory chunk?

(See the get in memory example.)

You are in full control of the callback function that gets called every time there is data received from the remote server. You can make that callback do whatever you want. You do not have to write the received data to a file.

One solution to this problem could be to have a pointer to a struct that you pass to the callback function. You set the pointer using the CURLOPT_WRITEDATA option. Then that pointer is passed to the callback instead of a FILE * to a file:

c
/* store data this struct */
struct MemoryStruct {
  char *memory;
  size_t size;
};

/* imaginary callback function */
size_t
WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
{
  size_t realsize = size * nmemb;
  struct MemoryStruct *mem = (struct MemoryStruct *)data;

  mem->memory = realloc(mem->memory, mem->size + realsize + 1);
  if(mem->memory) {
    memcpy(&(mem->memory[mem->size]), ptr, realsize);
    mem->size += realsize;
    mem->memory[mem->size] = 0;
  }
  return realsize;
}

How do I fetch multiple files with libcurl?

libcurl has excellent support for transferring multiple files. You should repeatedly set new URLs with curl_easy_setopt() and then transfer it with curl_easy_perform(). The handle you get from curl_easy_init() is not only reusable, but you are even encouraged to reuse it if you can, as that enables libcurl to use persistent connections.

Does libcurl do Winsock initialization on Win32 systems?

Yes, if told to in the curl_global_init() call.

Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on Win32 ?

Yes, but you cannot open a FILE * and pass the pointer to a DLL and have that DLL use the FILE * (as the DLL and the client application cannot access each others' variable memory areas). If you set CURLOPT_WRITEDATA you must also use CURLOPT_WRITEFUNCTION as well to set a function that writes the file, even if all it does is write the data to the specified FILE *. Similarly, if you use CURLOPT_READDATA you must also specify CURLOPT_READFUNCTION.

What about Keep-Alive or persistent connections?

curl and libcurl have excellent support for persistent connections when transferring several files from the same server. curl attempts to reuse connections for all URLs specified on the same command line/config file, and libcurl reuses connections for all transfers that are made using the same libcurl handle.

When you use the easy interface the connection cache is kept within the easy handle. If you instead use the multi interface, the connection cache is kept within the multi handle and shared among all the easy handles that are used within the same multi handle.

You need to make sure that your project, and all the libraries (both static and dynamic) that it links against, are compiled/linked against the same run time library.

This is determined by the /MD, /ML, /MT (and their corresponding /M?d) options to the command line compiler. /MD (linking against MSVCRT.dll) seems to be the most commonly used option.

When building an application that uses the static libcurl library, you must add -DCURL_STATICLIB to your CFLAGS. Otherwise the linker looks for dynamic import symbols. If you are using Visual Studio, you need to instead add CURL_STATICLIB in the "Preprocessor Definitions" section.

If you get a linker error like unknown symbol __imp__curl_easy_init ... you have linked against the wrong (static) library. If you want to use the libcurl.dll and import lib, you do not need any extra CFLAGS, but use one of the import libraries below. These are the libraries produced by the various lib/Makefile.* files:

Targetstatic libimport lib for DLL
MinGWlibcurl.alibcurldll.a
MSVC (release)libcurl.liblibcurl_imp.lib
MSVC (debug)libcurld.liblibcurld_imp.lib

libcurl.so.X: open failed: No such file or directory

This is an error message you might get when you try to run a program linked with a shared version of libcurl and your runtime linker (ld.so) could not find the shared library named libcurl.so.X. (Where X is the number of the current libcurl ABI, typically 3 or 4).

You need to make sure that ld.so finds libcurl.so.X. You can do that multiple ways, and it differs somewhat between different operating systems. They are usually:

  • Add an option to the linker command line that specify the hard-coded path the runtime linker should check for the lib (usually -R)
  • Set an environment variable (LD_LIBRARY_PATH for example) where ld.so should check for libs
  • Adjust the system's config to check for libs in the directory where you have put the library (like Linux's /etc/ld.so.conf)

man ld.so and man ld tells you more details

How does libcurl resolve hostnames?

libcurl supports a large number of name resolve functions. One of them is picked at build-time and used unconditionally. Thus, if you want to change name resolver function you must rebuild libcurl and tell it to use a different function.

The non-IPv6 resolver

The non-IPv6 resolver that can use one of four different hostname resolve calls depending on what your system supports:

  1. gethostbyname()
  2. gethostbyname_r() with 3 arguments
  3. gethostbyname_r() with 5 arguments
  4. gethostbyname_r() with 6 arguments

The IPv6 resolver

Uses getaddrinfo()

The cares resolver

The c-ares based name resolver that uses the c-ares library for resolves. Using this offers asynchronous name resolves.

The threaded resolver

It uses the IPv6 or the non-IPv6 resolver solution in a temporary thread.

How do I prevent libcurl from writing the response to stdout?

libcurl provides a default built-in write function that writes received data to stdout. Set the CURLOPT_WRITEFUNCTION to receive the data, or possibly set CURLOPT_WRITEDATA to a different FILE * handle.

How do I make libcurl not receive the whole HTTP response?

You make the write callback (or progress callback) return an error and libcurl then aborts the transfer.

Can I make libcurl fake or hide my real IP address?

No. libcurl operates on a higher level. Besides, faking IP address would imply sending IP packets with a made-up source address, and then you normally get a problem with receiving the packet sent back as they would then not be routed to you.

If you use a proxy to access remote sites, the sites do not see your local IP address but instead the address of the proxy.

Also note that on many networks NATs or other IP-munging techniques are used that makes you see and use a different IP address locally than what the remote server is seeing you coming from. You may also consider using Tor.

How do I stop an ongoing transfer?

With the easy interface you make sure to return the correct error code from one of the callbacks, but none of them are instant. There is no function you can call from another thread or similar that stops it immediately. Instead, you need to make sure that one of the callbacks you use returns an appropriate value that stops the transfer. Suitable callbacks that you can do this with include the progress callback, the read callback and the write callback.

If you are using the multi interface, you can also stop a transfer by removing the particular easy handle from the multi stack at any moment you think the transfer is done or when you wish to abort the transfer.

Using C++ non-static functions for callbacks?

libcurl is a C library, it does not know anything about C++ member functions.

You can overcome this limitation with relative ease using a static member function that is passed a pointer to the class:

c++
// f is the pointer to your object.
static size_t YourClass::func(char *buffer, size_t sz, size_t n, void *f)
{
  // Call non-static member function.
  static_cast<YourClass*>(f)->nonStaticFunction();
}

// This is how you pass pointer to the static function:
curl_easy_setopt(hcurl, CURLOPT_WRITEFUNCTION, YourClass::func);
curl_easy_setopt(hcurl, CURLOPT_WRITEDATA, this);

How do I get an FTP directory listing?

If you end the FTP URL you request with a slash, libcurl provides you with a directory listing of that given directory. You can also set CURLOPT_CUSTOMREQUEST to alter what exact listing command libcurl would use to list the files.

The follow-up question tends to be how is a program supposed to parse the directory listing. How does it know what's a file and what's a directory and what's a symlink etc. If the FTP server supports the MLSD command then it returns data in a machine-readable format that can be parsed for type. The types are specified by RFC 3659 section 7.5.1. If MLSD is not supported then you have to work with what you are given. The LIST output format is entirely at the server's own liking and the NLST output does not reveal any types and in many cases does not even include all the directory entries. Also, both LIST and NLST tend to hide Unix-style hidden files (those that start with a dot) by default so you need to do LIST -a or similar to see them.

Example - List only directories. ftp.funet.fi supports MLSD and ftp.kernel.org does not:

curl -s ftp.funet.fi/pub/ -X MLSD | \
  perl -lne 'print if s/(?:^|;)type=dir;[^ ]+ (.+)$/$1/'

curl -s ftp.kernel.org/pub/linux/kernel/ | \
  perl -lne 'print if s/^d[-rwx]{9}(?: +[^ ]+){7} (.+)$/$1/'

If you need to parse LIST output, libcurl provides the ability to specify a wildcard to download multiple files from an FTP directory.

I want a different time-out

Sometimes users realize that CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT are not sufficiently advanced or flexible to cover all the various use cases and scenarios applications end up with.

libcurl offers many more ways to time-out operations. A common alternative is to use the CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME options to specify the lowest possible speed to accept before to consider the transfer timed out.

The most flexible way is by writing your own time-out logic and using CURLOPT_XFERINFOFUNCTION (perhaps in combination with other callbacks) and use that to figure out exactly when the right condition is met when the transfer should get stopped.

Can I write a server with libcurl?

No. libcurl offers no functions or building blocks to build any kind of Internet protocol server. libcurl is only a client-side library. For server libraries, you need to continue your search elsewhere but there exist many good open source ones out there for most protocols you could want a server for. There are also really good stand-alone servers that have been tested and proven for many years. There is no need for you to reinvent them.

Does libcurl use threads?

No, libcurl executes in the same thread you call it in. All callbacks are called in the same thread as the one you call libcurl in.

If you want to avoid your thread to be blocked by the libcurl call, you make sure you use the non-blocking multi API which does transfers asynchronously - still in the same single thread.

libcurl does potentially internally use threads for name resolving, if it was built to work like that, but in those cases it creates the child threads by itself and they are only used and then killed internally by libcurl and never exposed to the outside.

License

curl and libcurl are released under an MIT/X derivative license. The license is liberal and should not impose a problem for your project. This section is a brief summary for the cases we get the most questions.

We are not lawyers and this is not legal advice. You should probably consult one if you want true and accurate legal insights without our prejudice. Note especially that this section concerns the libcurl license only; compiling in features of libcurl that depend on other libraries (e.g. OpenSSL) may affect the licensing obligations of your application.

I have a GPL program, can I use the libcurl library?

Yes

Since libcurl may be distributed under the MIT/X derivative license, it can be used together with GPL in any software.

I have a closed-source program, can I use the libcurl library?

Yes

libcurl does not put any restrictions on the program that uses the library.

I have a BSD licensed program, can I use the libcurl library?

Yes

libcurl does not put any restrictions on the program that uses the library.

I have a program that uses LGPL libraries, can I use libcurl?

Yes

The LGPL license does not clash with other licenses.

Can I modify curl/libcurl for my program and keep the changes secret?

Yes

The MIT/X derivative license practically allows you to do almost anything with the sources, on the condition that the copyright texts in the sources are left intact.

Can you please change the curl/libcurl license?

No.

We have carefully picked this license after years of development and discussions and a large amount of people have contributed with source code knowing that this is the license we use. This license puts the restrictions we want on curl/libcurl and it does not spread to other programs or libraries that use it. It should be possible for everyone to use libcurl or curl in their projects, no matter what license they already have in use.

What are my obligations when using libcurl in my commercial apps?

Next to none. All you need to adhere to is the MIT-style license (stated in the COPYING file) which says you have to include the copyright notice in all copies and that you may not use the copyright holder's name when promoting your software.

You do not have to release any of your source code.

You do not have to reveal or make public any changes to the libcurl source code.

You do not have to broadcast to the world that you are using libcurl within your app.

All we ask is that you disclose the copyright notice and this permission notice somewhere. Most probably like in the documentation or in the section where other third party dependencies already are mentioned and acknowledged.

As can be seen here and elsewhere, more and more companies are discovering the power of libcurl and take advantage of it even in commercial environments.

What license does curl use exactly?

curl is released under an MIT derivative license. It is similar but not identical to the MIT license.

The difference is considered big enough to make SPDX list it under its own identifier: curl.

The changes done to the license that make it uniquely curl were tiny and well-intended, but the reasons for them have been forgotten and we strongly discourage others from doing the same thing.

PHP/CURL

What is PHP/CURL?

The module for PHP that makes it possible for PHP programs to access curl functions from within PHP.

In the curl project we call this module PHP/CURL to differentiate it from curl the command line tool and libcurl the library. The PHP team however does not refer to it like this (for unknown reasons). They call it plain CURL (often using all caps) or sometimes ext/curl, but both cause much confusion to users which in turn gives us a higher question load.

Who wrote PHP/CURL?

PHP/CURL was initially written by Sterling Hughes.

Can I perform multiple requests using the same handle?

Yes.

After a transfer, you set new options in the handle and make another transfer. This makes libcurl reuse the same connection if it can.

Does PHP/CURL have dependencies?

PHP/CURL is a module that comes with the regular PHP package. It depends on and uses libcurl, so you need to have libcurl installed properly before PHP/CURL can be used.

Development

Why does curl use C89?

As with everything in curl, there is a history and we keep using what we have used before until someone brings up the subject and argues for and works on changing it.

We started out using C89 in the 1990s because that was the only way to write a truly portable C program and have it run as widely as possible. C89 was for a long time even necessary to make things work on otherwise considered modern platforms such as Windows. Today, we do not really know how many users that still require the use of a C89 compiler.

We continue to use C89 for as long as nobody brings up a strong enough reason for us to change our minds. The core developers of the project do not feel restricted by this and we are not convinced that going C99 offers us enough of a benefit to warrant the risk of cutting off a share of users.

Would curl be rewritten?

In one go: no. Little by little over time? Sure.

Over the years, new languages and clever operating environments come and go. Every now and then the urge apparently arises to request that we rewrite curl in another language.

Some the most important properties in curl are maintaining the API and ABI for libcurl and keeping the behavior for the command line tool. As long as we can do that, everything else is up for discussion. To maintain the ABI, we probably have to maintain a certain amount of code in C, and to remain rock stable, we never risk anything by rewriting a lot of things in one go. That said, we can certainly offer more and more optional backends written in other languages, as long as those backends can be plugged in at build-time. Backends can be written in any language, but should probably provide APIs usable from C to ease integration and transition.

1<!--
2Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
4SPDX-License-Identifier: curl
5-->
7# Frequently Asked Questions
9# Philosophy
11## What is curl?
13curl is the name of the project. The name is a play on *Client for URLs*,
14originally with URL spelled in uppercase to make it obvious it deals with
15URLs. The fact it can also be read as *see URL* also helped, it works as an
16abbreviation for *Client URL Request Library* or why not the recursive
17version: *curl URL Request Library*.
19The curl project produces two products:
21### libcurl
23A client-side URL transfer library, supporting DICT, FILE, FTP, FTPS, GOPHER,
24GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, MQTTS, POP3, POP3S,
25RTSP, SCP, SFTP, SMTP, SMTPS, TELNET, TFTP, WS and WSS.
27libcurl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading,
28Kerberos, SPNEGO, HTTP form based upload, proxies, cookies, user+password
29authentication, file transfer resume, http proxy tunneling and more.
31libcurl is highly portable, it builds and works identically on numerous
32platforms. The [internals document](https://curl.se/docs/install.html#Ports)
33lists more than 110 operating systems and 28 CPU architectures on which curl
34has been reported to run.
36libcurl is free, thread-safe, IPv6 compatible, feature-rich, well supported
37and fast.
39### curl
41A command line tool for getting or sending data using URL syntax.
43Since curl uses libcurl, curl supports the same wide range of common Internet
44protocols that libcurl does.
46We pronounce curl with an initial k sound. It rhymes with words like girl and
47earl. [This is a short WAV
48file](https://media.merriam-webster.com/soundc11/c/curl0001.wav) to help you.
50There are numerous sub-projects and related projects that also use the word
51curl in the project names in various combinations, but you should take notice
52that this FAQ is directed at the command-line tool named curl (and libcurl the
53library), and may therefore not be valid for other curl-related projects.
54(There is however a small section for the PHP/CURL in this FAQ.)
56## What is libcurl?
58libcurl is a reliable and portable library for doing Internet data transfers
59using one or more of its supported Internet protocols.
61You can use libcurl freely in your application, be it open source, commercial
62or closed-source.
64libcurl is most probably the most portable, most powerful and most often used
65C-based multi-platform file transfer library on this planet - be it open
66source or commercial.
68## What is curl not?
70curl is not a Wget clone. That is a common misconception. Never, during curl's
71development, have we intended curl to replace Wget or compete on its market.
72curl is targeted at single-shot file transfers.
74curl is not a website mirroring program. If you want to use curl to mirror
75something: fine, go ahead and write a script that wraps around curl or use
76libcurl to make it reality.
78curl is not an FTP site mirroring program. Sure, get and send FTP with curl
79but if you want systematic and sequential behavior you should write a script
80(or write a new program that interfaces libcurl) and do it.
82curl is not a PHP tool, even though it works perfectly well when used from or
83with PHP (when using the PHP/CURL module).
85curl is not a program for a single operating system. curl exists, compiles,
86builds and runs under a wide range of operating systems, including all modern
87Unixes (and a bunch of older ones too), Windows, Amiga, OS/2, macOS, QNX etc.
89## When would you make curl do ... ?
91We love suggestions of what to change in order to make curl and libcurl
92better. We do however believe in a few rules when it comes to the future of
93curl:
95curl the command line tool is to remain a non-graphical command line tool. If
96you want GUIs or fancy scripting capabilities, you should look for another
97tool that uses libcurl.
99We do not add things to curl that other small and available tools already do
100well at the side. curl's output can be piped into another program or
101redirected to another file for the next program to interpret.
103We focus on protocol related issues and improvements. If you want to do more
104with the supported protocols than curl currently does, chances are good we
105would agree. If you want to add more protocols, we may agree.
107If you want someone else to do all the work while you wait for us to implement
108it for you, that is not a friendly attitude. We spend a considerable time
109already on maintaining and developing curl. In order to get more out of us,
110you should consider trading in some of your time and effort in return. Go to
111the [GitHub repository](https://github.com/curl/curl), fork the project,
112and create pull requests with your proposed changes.
114If you write the code, chances are better that it gets into curl faster.
116## Who makes curl?
118curl and libcurl are not made by any single individual. Daniel Stenberg is
119project leader and main developer, but other persons' submissions are
120important and crucial. Anyone can contribute and post their changes and
121improvements and have them inserted in the main sources (of course on the
122condition that developers agree that the fixes are good).
124The full list of all contributors is found in the
125[docs/THANKS](https://curl.se/docs/thanks.html) file.
127curl is developed by a community, with Daniel at the wheel.
129## What do you get for making curl?
131Project curl is entirely free and open. We do this voluntarily, mostly in our
132spare time. Companies may pay individual developers to work on curl. This is
133not controlled by nor supervised in any way by the curl project.
135We get help from companies. Haxx provides website, bandwidth, mailing lists
136etc, GitHub hosts [the primary git repository](https://github.com/curl/curl)
137and other services like the bug tracker. Also again, some companies have
138sponsored certain parts of the development in the past and I hope some
139continue to do so in the future.
141If you want to [support our project](https://curl.se/sponsors.html), consider
142a donation or a banner-program or even better: by helping us with coding,
143documenting or testing etc.
145## What about CURL from curl.com?
147During the summer of 2001, curl.com was busy advertising their client-side
148programming language for the web, named CURL.
150We are in no way associated with curl.com or their CURL programming language.
152Our project name curl has been in effective use since 1998. We were not the
153first computer related project to use the name *curl* and do not claim any
154rights to the name.
156We recognize that we are living in parallel with curl.com and wish them
157every success.
159## I have a problem, who do I mail?
161Please do not mail any single individual unless you really need to. Keep
162curl-related questions on a suitable mailing list. All available mailing lists
163are listed [online](https://curl.se/mail/).
165Keeping curl-related questions and discussions on mailing lists allows others
166to join in and help, to share their ideas, to contribute their suggestions and
167to spread their wisdom. Keeping discussions on public mailing lists also
168allows for others to learn from this (both current and future users thanks to
169the web based archives of the mailing lists), thus saving us from having to
170repeat ourselves even more. Thanks for respecting this.
172If you have found or suspect a security problem in curl or libcurl,
173[submit all the details to us](https://curl.se/dev/vuln-disclosure.html). We
174keep the issue private while we investigate, confirm it, work and validate a
175fix and agree on a time schedule for publication etc. That way we produce a
176fix in a timely manner before the flaw is announced to the world, reducing the
177impact the problem risks having on existing users.
179Security issues can also be taken to the curl security team by emailing
180security at curl.se (closed list of receivers, mails are not disclosed).
182## Where do I buy commercial support for curl?
184curl is fully open source. It means you can hire any skilled engineer to fix
185your curl-related problems.
187We list [available alternatives](https://curl.se/support.html).
189## How many are using curl?
191It is impossible to tell.
193We do not know how many users that knowingly have installed and use curl.
195We do not know how many users that use curl without knowing that they are in
196fact using it.
198We do not know how many users that downloaded or installed curl and then never
199use it.
201In 2025, we estimate that curl runs in roughly thirty billion installations
202world wide.
204## Why do you not update ca-bundle.crt
206In the curl project we have decided not to attempt to keep this file updated
207(or even present) since deciding what to add to a CA cert bundle is an
208undertaking we have not been ready to accept, and the one we can get from
209Mozilla is perfectly fine so there is no need to duplicate that work.
211Today, with many services performed over HTTPS, every operating system should
212come with a default CA cert bundle that can be deemed somewhat trustworthy and
213that collection (if reasonably updated) should be deemed to be a lot better
214than a private curl version.
216If you want the most recent collection of CA certs that Mozilla Firefox uses,
217we recommend using our online [CA certificate
218service](https://curl.se/docs/caextract.html) setup for this purpose.
220## I have a problem, who can I chat with?
222There is a bunch of friendly people hanging out in the #curl channel on the
223IRC network libera.chat. If you are polite and nice, chances are good that you
224can get -- or provide -- help instantly.
226## curl's ECCN number?
228The US government restricts exports of software that contains or uses
229cryptography. When doing so, the Export Control Classification Number (ECCN)
230is used to identify the level of export control etc.
232Apache Software Foundation has [a good explanation of
233ECCN](https://www.apache.org/dev/crypto.html).
235We believe curl's number might be ECCN 5D002, another possibility is 5D992. It
236seems necessary to write them (the authority that administers ECCN numbers),
237asking to confirm.
239Comprehensible explanations of the meaning of such numbers and how to obtain
240them (resp.) are [here](https://www.bis.gov/licensing/classify-your-item)
241and [here](https://www.bis.gov/licensing/classify-your-item/publicly-available-classification-information).
243An incomprehensible description of the two numbers above is available on
244[bis.doc.gov](https://www.bis.doc.gov/index.php/documents/new-encryption/1653-ccl5-pt2-3)
246## How do I submit my patch?
248We strongly encourage you to submit changes and improvements directly as [pull
249requests on GitHub](https://github.com/curl/curl/pulls).
251If you cannot or choose not to engage with GitHub, send your patch
252to the curl-library mailing list. We are many subscribers there and there are
253lots of people who can review patches, comment on them and receive them
254properly.
256Many more details are found in the
257[contribute](https://curl.se/dev/contribute.html) and
258[internals](https://curl.se/dev/internals.html)
259documents.
261## How do I port libcurl to my OS?
263Here's a rough step-by-step:
2651. copy a suitable `lib/config-*.h` file as a start to `lib/config-[youros].h`
2662. edit `lib/config-[youros].h` to match your OS and setup
2673. edit `lib/curl_setup.h` to include `config-[youros].h` when your OS is
268 detected by the preprocessor, in the style others already exist
2694. compile `lib/*.c` and make them into a library
271# Install
273## configure fails when using static libraries
275You may find that configure fails to properly detect the entire dependency
276chain of libraries when you provide static versions of the libraries that
277configure checks for.
279The reason why static libraries are much harder to deal with is that for them
280we do not get any help but the script itself must know or check what more
281libraries that are needed (with shared libraries, that dependency chain is
282handled automatically). This is an error-prone process and one that also tends
283to vary over time depending on the release versions of the involved components
284and may also differ between operating systems.
286For that reason, configure does few attempts to actually figure this out and
287you are instead encouraged to set `LIBS` and `LDFLAGS` accordingly when you invoke
288configure, and point out the needed libraries and set the necessary flags
289yourself.
291## Does curl work with other SSL libraries?
293curl has been written to use a generic SSL function layer internally, and
294that SSL functionality can then be provided by one out of many different SSL
295backends.
297curl can be built to use one of the following SSL alternatives: AWS-LC,
298BoringSSL, GnuTLS, LibreSSL, OpenSSL, mbedTLS, Rustls, Schannel (native
299Windows), or wolfSSL. They all have their pros and cons, and we maintain
300[a TLS library comparison](https://curl.se/docs/ssl-compared.html).
302## How do I upgrade curl.exe in Windows?
304The curl tool that is shipped as an integrated component of Windows 10 and
305Windows 11 is managed by Microsoft. If you were to delete the file or replace
306it with a newer version downloaded from [the curl
307website](https://curl.se/windows/), then Windows Update ceases to work on
308your system.
310There is no way to independently force an upgrade of the curl.exe that is part
311of Windows other than through the regular Windows update process. There is
312also nothing the curl project itself can do about this, since this is managed
313and controlled entirely by Microsoft as owners of the operating system.
315You can always download and install [the latest version of curl for
316Windows](https://curl.se/windows/) into a separate location.
318## Does curl support SOCKS (RFC 1928) ?
320Yes, SOCKS 4 and 5 are supported.
322# Usage
324## curl: (1) SSL is disabled, https: not supported
326If you get this output when trying to get anything from an HTTPS server, it
327means that the instance of curl/libcurl that you are using was built without
328support for this protocol.
330This could have happened if the configure script that was run at build time
331could not find all libs and include files curl requires for SSL to work. If
332the configure script fails to find them, curl is built without SSL
333support.
335To get HTTPS support into a curl that was previously built but that reports
336that HTTPS is not supported, you should dig through the document and logs and
337check out why the configure script does not find the SSL libs and/or include
338files.
340## How do I tell curl to resume a transfer?
342curl supports resumed HTTP, FTP and SFTP downloads as well as resumed FTP and
343SFTP uploads. Try the `-C` option.
345## Why does my posting using -F not work?
347You cannot arbitrarily use `-F` or `-d`, the choice between `-F` or `-d`
348depends on the HTTP operation you need curl to do and what the web server that
349receives your post expects.
351If the form you are trying to submit uses the type 'multipart/form-data',
352then and only then you must use the -F type. In all the most common cases,
353you should use `-d` which then causes a posting with the type
354`application/x-www-form-urlencoded`.
356This is described in some detail in the
357[Manual](https://curl.se/docs/tutorial.html) and [The Art Of HTTP
358Scripting](https://curl.se/docs/httpscripting.html) documents, and if you do
359not understand it the first time, read it again before you post questions
360about this to the mailing list. Also, try reading through the mailing list
361archives for old postings and questions regarding this.
363## How do I tell curl to run custom FTP commands?
365You can tell curl to perform optional commands both before and/or after a file
366transfer. Study the `-Q`/`--quote` option.
368Since curl is used for file transfers, you do not normally use curl to perform
369FTP commands without transferring anything. Therefore you must always specify
370a URL to transfer to/from even when doing custom FTP commands, or use `-I`
371which implies the *no body* option sent to libcurl.
373## How can I disable the Accept: header?
375You can change this and all internally generated headers by adding a
376replacement with the `-H`/`--header` option. By adding a header with empty
377contents you safely disable that one. Use `-H Accept:` to disable that
378specific header.
380## Does curl support ASP, XML, XHTML or HTML version Y?
382To curl, all contents are alike. It does not matter how the page was
383generated. It may be ASP, PHP, Perl, shell-script, SSI or plain HTML
384files. There is no difference to curl and it does not even know what kind of
385language that generated the page.
387See also the separate question about JavaScript.
389## Can I use curl to delete/rename a file through FTP?
391Yes. You specify custom FTP commands with `-Q`/`--quote`.
393One example would be to delete a file after you have downloaded it:
395 curl -O ftp://example.com/coolfile -Q '-DELE coolfile'
397or rename a file after upload:
399 curl -T infile ftp://example.com/dir/ -Q "-RNFR infile" -Q "-RNTO newname"
401## How do I tell curl to follow HTTP redirects?
403curl does not follow so-called redirects by default. The `Location:` header that
404informs the client about this is only interpreted if you are using the
405`-L`/`--location` option. As in:
407 curl -L https://example.com
409Not all redirects are HTTP ones. See [Redirects work in browser but not with
410curl](#redirects-work-in-browser-but-not-with-curl)
412## How do I use curl in my favorite programming language?
414Many programming languages have interfaces and bindings that allow you to use
415curl without having to use the command line tool. If you are fluent in such a
416language, you may prefer to use one of these interfaces instead.
418Find out more about which languages that support curl directly, and how to
419install and use them, in the [libcurl section of the curl
420website](https://curl.se/libcurl/).
422All the various bindings to libcurl are made by other projects and people,
423outside of the curl project. The curl project itself only produces libcurl
424with its plain C API. If you do not find anywhere else to ask you can ask
425about bindings on the curl-library list too, but be prepared that people on
426that list may not know anything about bindings.
428In December 2025 there were around **60** different [interfaces
429available](https://curl.se/libcurl/bindings.html) for almost any language you
430can imagine.
432## What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP?
434curl adheres to the HTTP spec, which means you can play with *any* protocol
435that is built on top of HTTP. Protocols such as SOAP, WebDAV and XML-RPC are
436all such ones. You can use `-X` to set custom requests and -H to set custom
437headers (or replace internally generated ones).
439Using libcurl of course also works and you would use the proper library
440options to do the same.
442## How do I POST with a different Content-Type?
444You can always replace the internally generated headers with `-H`/`--header`.
445To make a simple HTTP POST with `text/xml` as content-type, do something like:
447 curl -d "datatopost" -H "Content-Type: text/xml" [URL]
449## Why do FTP-specific features over HTTP proxy fail?
451Because when you use an HTTP proxy, the protocol spoken on the network is
452HTTP, even if you specify an FTP URL. This effectively means that you normally
453cannot use FTP-specific features such as FTP upload and FTP quote etc.
455There is one exception to this rule, and that is if you can *tunnel through*
456the given HTTP proxy. Proxy tunneling is enabled with a special option (`-p`)
457and is generally not available as proxy admins usually disable tunneling to
458ports other than 443 (which is used for HTTPS access through proxies).
460## Why do my single/double quotes fail?
462To specify a command line option that includes spaces, you might need to put
463the entire option within quotes. Like in:
465 curl -d " with spaces " example.com
467or perhaps
469 curl -d ' with spaces ' example.com
471Exactly what kind of quotes and how to do this is entirely up to the shell or
472command line interpreter that you are using. For most Unix shells, you can
473more or less pick either single (`'`) or double (`"`) quotes. For Windows/DOS
474command prompts you must use double (") quotes, and if the option string
475contains inner double quotes you can escape them with a backslash.
477For Windows PowerShell the arguments are not always passed on as expected
478because curl is not a PowerShell script. You may or may not be able to use
479single quotes. To escape inner double quotes seems to require a
480backslash-backtick escape sequence and the outer quotes as double quotes.
482Please study the documentation for your particular environment. Examples in
483the curl docs use a mix of both of these as shown above. You must adjust them
484to work in your environment.
486Remember that curl works and runs on more operating systems than most single
487individuals have ever tried.
489## Does curl support JavaScript or PAC (automated proxy config)?
491Many webpages do stuff using embedded JavaScript. curl and libcurl have
492no built-in support for that, so it is treated like any other contents.
494`.pac` files are a Netscape invention and are sometimes used by organizations
495to allow them to differentiate which proxies to use. The `.pac` contents is a
496JavaScript program that gets invoked by the browser and that returns the name
497of the proxy to connect to. Since curl does not support JavaScript, it cannot
498support .pac proxy configuration either.
500Some workarounds usually suggested to overcome this JavaScript dependency:
502Depending on the JavaScript complexity, write up a script that translates it
503to another language and execute that.
505Read the JavaScript code and rewrite the same logic in another language.
507Implement a JavaScript interpreter, people have successfully used the
508Mozilla JavaScript engine in the past.
510Ask your admins to stop this, for a static proxy setup or similar.
512## Can I do recursive fetches with curl?
514No. curl itself has no code that performs recursive operations, such as those
515performed by Wget and similar tools.
517There exists curl using scripts with that functionality, and you can write
518programs based on libcurl to do it, but the command line tool curl itself
519cannot.
521## What certificates do I need when I use SSL?
523There are three different kinds of certificates to keep track of when we talk
524about using SSL-based protocols (HTTPS or FTPS) using curl or libcurl.
526### Client certificate
528The server you communicate with may require that you can provide this in
529order to prove that you actually are who you claim to be. If the server
530does not require this, you do not need a client certificate.
532A client certificate is always used together with a private key, and the
533private key has a passphrase that protects it.
535### Server certificate
537The server you communicate with has a server certificate. You can and should
538verify this certificate to make sure that you are truly talking to the real
539server and not a server impersonating it.
541Servers often also provide an intermediate certificate. It acts as a bridge
542between a website's SSL certificate and a Certificate Authority's (CA) root
543certificate, creating a "chain of trust".
545### Certificate Authority Certificate ("CA cert")
547You often have several CA certs in a CA cert bundle that can be used to verify
548a server certificate that was signed by one of the authorities in the bundle.
549curl does not come with a CA cert bundle but most curl installs provide one.
550You can also override the default.
552Server certificate verification is enabled by default in curl and libcurl.
553Server certificates that are *self-signed* or otherwise signed by a CA that
554you do not have a CA cert for, cannot be verified. If the verification during
555a connect fails, you are refused access. You then might have to explicitly
556disable the verification to connect to the server.
558## How do I list the root directory of an FTP server?
560There are two ways. The way defined in the RFC is to use an encoded slash in
561the first path part. List the `/tmp` directory like this:
563 curl ftp://ftp.example.com/%2ftmp/
565The second way is non-standard but more readable; start the path section of the
566URL with a slash:
568 curl ftp://ftp.example.com//tmp/
570## Can I use curl to send a POST/PUT and not wait for a response?
572No.
574You can easily write your own program using libcurl to do such stunts.
576## How do I get HTTP from a host using a specific IP address?
578For example, you may be trying out a website installation that is not yet in
579the DNS. Or you have a site using multiple IP addresses for a given host
580name and you want to address a specific one out of the set.
582Set a custom `Host:` header that identifies the server name you want to reach
583but use the target IP address in the URL:
585 curl --header "Host: www.example.com" https://somewhere.example/
587You can also opt to add faked hostname entries to curl with the --resolve
588option. That has the added benefit to make things like redirects also work
589properly. The above operation would instead be done as:
591 curl --resolve www.example.com:80:127.0.0.1 https://www.example.com/
593## How to SFTP from my user's home directory?
595Contrary to how FTP works, SFTP and SCP URLs specify the exact directory to
596work with. It means that if you do not specify that you want the user's home
597directory, you get the actual root directory.
599To specify a file in your user's home directory, you need to use the correct
600URL syntax which for SFTP might look similar to:
602 curl -O -u user:password sftp://example.com/~/file.txt
604and for SCP it is a different protocol prefix:
606 curl -O -u user:password scp://example.com/~/file.txt
608## Protocol xxx not supported or disabled in libcurl
610When passing on a URL to curl to use, it may respond that the particular
611protocol is not supported or disabled. The particular way this error message
612is phrased is because curl does not make a distinction internally of whether a
613particular protocol is not supported (i.e. never got any code added that knows
614how to speak that protocol) or if it was explicitly disabled. curl can be
615built to only support a given set of protocols, and the rest would then be
616disabled or not supported.
618Note that this error also occurs if you pass a wrongly spelled protocol part
619as in `htpts://example.com` or as in the less evident case if you prefix
620the protocol part with a space as in `" https://example.com/"`.
622## curl `-X` gives me HTTP problems
624In normal circumstances, `-X` should hardly ever be used.
626By default you use curl without explicitly saying which request method to use
627when the URL identifies an HTTP transfer. If you pass in a URL like `curl
628https://example.com` it uses GET. If you use `-d` or `-F`, curl uses POST,
629`-I` causes a HEAD and `-T` makes it a PUT.
631If for whatever reason you are not happy with these default choices that curl
632does for you, you can override those request methods by specifying `-X
633[WHATEVER]`. This way you can for example send a DELETE by doing
634`curl -X DELETE [URL]`.
636It is thus pointless to do `curl -XGET [URL]` as GET would be used anyway. In
637the same vein it is pointless to do `curl -X POST -d data [URL]`. You can make
638a fun and somewhat rare request that sends a request-body in a GET request
639with something like `curl -X GET -d data [URL]`.
641Note that `-X` does not actually change curl's behavior as it only modifies
642the actual string sent in the request, but that may of course trigger a
643different set of events.
645Accordingly, by using `-XPOST` on a command line that for example would follow
646a 303 redirect, you effectively prevent curl from behaving correctly. Be aware.
648## Why is no `LOGOUT` or `QUIT` sent when the login fails?
650When curl fails to log in to an IMAP, POP3 or SMTP server, for example because
651the server rejects the username or password, it closes the connection without
652first sending the disconnect command of the protocol (`LOGOUT` for IMAP, `QUIT`
653for POP3 and SMTP).
655libcurl handles authentication as part of setting up the connection, and a
656connection that fails during setup is closed directly. Servers need to cope
657with clients that disconnect without a goodbye anyway, so this is expected and
658accepted behavior.
660# Running
662## Why do I get problems when I use & or % in the URL?
664In general Unix shells, the & symbol is treated specially and when used, it
665runs the specified command in the background. To safely send the & as a part
666of a URL, you should quote the entire URL by using single (`'`) or double
667(`"`) quotes around it. Similar problems can also occur on some shells with
668other characters, including ?*!$~(){}<>\|;`. When in doubt, quote the URL.
670An example that would invoke a remote CGI that uses &-symbols could be:
672 curl 'https://www.example.com/cgi-bin/query?text=yes&q=curl'
674In Windows, the standard DOS shell treats the percent sign specially and you
675need to use TWO percent signs for each single one you want to use in the URL.
677If you want a literal percent sign to be part of the data you pass in a POST
678using `-d`/`--data` you must encode it as `%25` (which then also needs the
679percent sign doubled on Windows machines).
681## How can I use {, }, [ or ] to specify multiple URLs?
683Because those letters have a special meaning to the shell, to be used in a URL
684specified to curl you must quote them.
686An example that downloads two URLs (sequentially) would be:
688 curl '{curl,www}.haxx.se'
690To be able to use those characters as actual parts of the URL (without using
691them for the curl URL *globbing* system), use the `-g`/`--globoff` option:
693 curl -g 'www.example.com/weirdname[].html'
695## Why do I get downloaded data even though the webpage does not exist?
697curl asks remote servers for the page you specify. If the page does not exist
698at the server, the HTTP protocol defines how the server should respond and
699that means that headers and a page get returned. That is how HTTP works.
701By using the `--fail` option you can tell curl explicitly to not get any data
702if the HTTP return code does not say success.
704## Why do I get return code XXX from an HTTP server?
706RFC 2616 clearly explains the return codes. This is a short transcript. Go
707read the RFC for exact details:
709### 400 Bad Request
711The request could not be understood by the server due to malformed
712syntax. The client SHOULD NOT repeat the request without modifications.
714### 401 Unauthorized
716The request requires user authentication.
718### 403 Forbidden
720The server understood the request, but is refusing to fulfill it.
721Authorization cannot help and the request SHOULD NOT be repeated.
723### 404 Not Found
725The server has not found anything matching the Request-URI. No indication is
726given as to whether the condition is temporary or permanent.
728### 405 Method Not Allowed
730The method specified in the Request-Line is not allowed for the resource
731identified by the Request-URI. The response MUST include an `Allow:` header
732containing a list of valid methods for the requested resource.
734### 301 Moved Permanently
736If you get this return code and an HTML output similar to this:
738 <H1>Moved Permanently</H1> The document has moved <A
739 HREF="https://same_url_now_with_a_trailing_slash.example/">here</A>.
741it might be because you requested a directory URL but without the trailing
742slash. Try the same operation again _with_ the trailing URL, or use the
743`-L`/`--location` option to follow the redirection.
745## Can you tell me what error code 142 means?
747All curl error codes are described at the end of the man page, in the section
748called **EXIT CODES**.
750Error codes that are larger than the highest documented error code means that
751curl has exited due to a crash. This is a serious error, and we appreciate a
752detailed bug report from you that describes how we could go ahead and repeat
753this.
755## How do I keep usernames and passwords secret in curl command lines?
757This problem has two sides:
759The first part is to avoid having clear-text passwords in the command line so
760that they do not appear in *ps* outputs and similar. That is easily avoided by
761using the `-K` option to tell curl to read parameters from a file or stdin to
762which you can pass the secret info. curl itself also attempts to hide the given
763password by blanking out the option - this does not work on all platforms.
765To keep the passwords in your account secret from the rest of the world is
766not a task that curl addresses. You could of course encrypt them somehow to
767at least hide them from being read by human eyes, but that is not what
768anyone would call security.
770Also note that regular HTTP (using Basic authentication) and FTP passwords are
771sent as cleartext across the network. All it takes for anyone to fetch them is
772to listen on the network. Eavesdropping is easy. Use more secure
773authentication methods (like Digest or Negotiate) or consider the SSL-based
774alternatives HTTPS and FTPS.
776## I found a bug
778It is not a bug if the behavior is documented. Read the docs first. Especially
779check out the KNOWN_BUGS file, it may be a documented bug.
781If it is a problem with a binary you have downloaded or a package for your
782particular platform, try contacting the person who built the package/archive
783you have.
785If there is a bug, read the BUGS document first. Then report it as described
786in there.
788## My HTTP request using HEAD, PUT or DELETE does not work
790Many web servers allow or demand that the administrator configures the server
791properly for these requests to work on the web server.
793Some servers seem to support HEAD only on certain kinds of URLs.
795To fully grasp this, try the documentation for the particular server software
796you are trying to interact with. This is not anything curl can do anything
797about.
799## Why do my HTTP range requests return the full document?
801Because the range may not be supported by the server, or the server may choose
802to ignore it and return the full document anyway.
804## Why do I get "certificate verify failed" ?
806When you invoke curl and get an error 60 error back it means that curl could
807not verify that the server's certificate was good. curl verifies the
808certificate using the CA cert bundle and verifying for which names the
809certificate has been granted.
811To completely disable the certificate verification, use `-k`. This does
812however enable man-in-the-middle attacks and makes the transfer **insecure**.
813We strongly advise against doing this for more than experiments.
815If you get this failure with a CA cert bundle installed and used, the server's
816certificate might not be signed by one of the certificate authorities in your
817CA store. It might for example be self-signed. You then correct this problem
818by obtaining a valid CA cert for the server. Or again, decrease the security
819by disabling this check.
821At times, you find that the verification works in your favorite browser but
822fails in curl. When this happens, the reason is usually that the server sends
823an incomplete cert chain. The server is mandated to send all *intermediate
824certificates* but does not. This typically works with browsers anyway since
825they A) cache such certs and B) supports AIA which downloads such missing
826certificates on demand. This is a bad server configuration. A good way to
827figure out if this is the case it to use [the SSL Labs
828server](https://www.ssllabs.com/ssltest/) test and check the certificate
829chain.
831Details are also in [the SSL certificates
832document](https://curl.se/docs/sslcerts.html).
834## Why is curl -R on Windows one hour off?
836Since curl 7.53.0 this issue should be fixed as long as curl was built with
837any modern compiler that allows for a 64-bit curl_off_t type. For older
838compilers or prior curl versions it may set a time that appears one hour off.
839This happens due to a flaw in how Windows stores and uses file modification
840times and it is not easily worked around. For more details
841[read this](https://web.archive.org/web/20050715084352/codeproject.com/datetime/dstbugs.asp).
843## Redirects work in browser but not with curl
845curl supports HTTP redirects well (see a previous question above). Browsers
846generally support at least two other ways to perform redirects that curl does
847not:
849Meta tags. You can write an HTML tag that causes the browser to redirect
850to another given URL after a certain time.
852JavaScript. You can write a JavaScript program embedded in an HTML page that
853redirects the browser to another given URL.
855There is no way to make curl follow these redirects. You must either manually
856figure out what the page is set to do, or write a script that parses the
857results and fetches the new URL.
859## FTPS does not work
861curl supports FTPS (sometimes known as FTP-SSL) both implicit and explicit
862mode.
864When a URL is used that starts with `ftps://`, curl assumes implicit SSL on
865the control connection and therefore immediately connects and tries to speak
866SSL. `ftps://` connections default to port 990.
868To use explicit FTPS, you use an `ftp://` URL and the `--ssl-reqd` option (or
869one of its related flavors). This is the most common method, and the one
870mandated by RFC 4217. This kind of connection then of course uses the standard
871FTP port 21 by default.
873## My HTTP POST or PUT requests are slow
875libcurl makes all POST and PUT requests (except for requests with a small
876request body) use the `Expect: 100-continue` header. This header allows the
877server to deny the operation early so that libcurl can bail out before having
878to send any data. This is useful in authentication cases and others.
880Many servers do not implement the `Expect:` stuff properly and if the server
881does not respond (positively) within 1 second libcurl continues and sends
882off the data anyway.
884You can disable libcurl's use of the `Expect:` header the same way you disable
885any header, using `-H` / `CURLOPT_HTTPHEADER`, or by forcing it to use HTTP
8861.0.
888## Non-functional connect timeouts
890In most Windows setups having a timeout longer than 21 seconds makes no
891difference, as it only sends 3 TCP SYN packets and no more. The second
892packet sent three seconds after the first and the third six seconds after
893the second. No more than three packets are sent, no matter how long the
894timeout is set.
896See Windows option `TcpMaxConnectRetransmissions` for more.
898Also, even on non-Windows systems there may run a firewall or anti-virus
899software or similar that accepts the connection but does not actually do
900anything else. This makes (lib)curl to consider the connection connected
901and thus the connect timeout does not trigger.
903## `file://` URLs containing drive letters (Windows, NetWare)
905When using curl to try to download a local file, one might use a URL in this
906format:
908 file://D:/blah.txt
910you find that even if `D:\blah.txt` does exist, curl returns a 'file not
911found' error.
913According to [RFC 1738](https://datatracker.ietf.org/doc/html/rfc1738),
914`file://` URLs must contain a host component, but it is ignored by most
915implementations. In the above example, `D:` is treated as the host component,
916and is taken away. Thus, curl tries to open `/blah.txt`. If your system is
917installed to drive C:, that resolves to `C:\blah.txt`, and if that does
918not exist you get the not found error.
920To fix this problem, use `file://` URLs with *three* leading slashes:
922 file:///D:/blah.txt
924Alternatively, if it makes more sense, specify `localhost` as the host
925component:
927 file://localhost/D:/blah.txt
929In either case, curl should now be looking for the correct file.
931## Why does not curl return an error when the network cable is unplugged?
933Unplugging a cable is not an error situation. The TCP/IP protocol stack was
934designed to be fault tolerant, so even though there may be a physical break
935somewhere the connection should not be affected, but possibly delayed.
936Eventually, the physical break gets fixed or the data re-routed around
937the physical problem through another path.
939In such cases, the TCP/IP stack is responsible for detecting when the network
940connection is irrevocably lost. Since with some protocols it is perfectly
941legal for the client to wait indefinitely for data, the stack may never report
942a problem, and even when it does, it can take up to 20 minutes for it to
943detect an issue. The curl option `--keepalive-time` enables keep-alive support
944in the TCP/IP stack which makes it periodically probe the connection to make
945sure it is still available to send data. That should reliably detect any
946TCP/IP network failure.
948TCP keep alive does not detect the network going down before the TCP/IP
949connection is established (e.g. during a DNS lookup) or using protocols that
950do not use TCP. To handle those situations, curl offers a number of timeouts
951on its own. `--speed-limit`/`--speed-time` aborts if the data transfer rate
952falls too low, and `--connect-timeout` and `--max-time` can be used to put
953an overall timeout on the connection phase or the entire transfer.
955A libcurl-using application running in a known physical environment (e.g. an
956embedded device with only a single network connection) may want to act
957immediately if its lone network connection goes down. That can be achieved by
958having the application monitor the network connection on its own using an
959OS-specific mechanism, then signaling libcurl to abort.
961## curl does not return error for HTTP non-200 responses
963Correct. Unless you use `-f` (`--fail`) or `--fail-with-body`.
965When doing HTTP transfers, curl performs exactly what you are asking it to
966do and if successful it does not return an error. You can use curl to test
967your web server's "file not found" page (that gets 404 back), you can use it
968to check your authentication protected webpages (that gets a 401 back) and so
969on.
971The specific HTTP response code does not constitute a problem or error for
972curl. It sends and delivers HTTP as you asked and if that worked,
973everything is fine and dandy. The response code is generally providing more
974higher level error information that curl does not care about. The error was
975not in the HTTP transfer.
977If you want your command line to treat error codes in the 400 and up range as
978errors and thus return a non-zero value and possibly show an error message,
979curl has a dedicated option for that: `-f` (`CURLOPT_FAILONERROR` in libcurl
980speak).
982You can also use the `-w` option and the variable `%{response_code}` to
983extract the exact response code that was returned in the response.
985# libcurl
987## Is libcurl thread-safe?
989Yes.
991We have written the libcurl code specifically adjusted for multi-threaded
992programs. libcurl uses thread-safe functions instead of non-safe ones if your
993system has such. Note that you must never share the same handle in multiple
994threads.
996There may be some exceptions to thread-safety depending on how libcurl was
997built. Please review [the guidelines for thread
998safety](https://curl.se/libcurl/c/threadsafe.html) to learn more.
1000## How can I receive all data into a large memory chunk?
1002(See the [get in memory](https://curl.se/libcurl/c/getinmemory.html) example.)
1004You are in full control of the callback function that gets called every time
1005there is data received from the remote server. You can make that callback do
1006whatever you want. You do not have to write the received data to a file.
1008One solution to this problem could be to have a pointer to a struct that you
1009pass to the callback function. You set the pointer using the CURLOPT_WRITEDATA
1010option. Then that pointer is passed to the callback instead of a FILE *
1011to a file:
1013~~~c
1014/* store data this struct */
1015struct MemoryStruct {
1016 char *memory;
1017 size_t size;
1020/* imaginary callback function */
1021size_t
1022WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
1024 size_t realsize = size * nmemb;
1025 struct MemoryStruct *mem = (struct MemoryStruct *)data;
1027 mem->memory = realloc(mem->memory, mem->size + realsize + 1);
1028 if(mem->memory) {
1029 memcpy(&(mem->memory[mem->size]), ptr, realsize);
1030 mem->size += realsize;
1031 mem->memory[mem->size] = 0;
1033 return realsize;
1035~~~
1037## How do I fetch multiple files with libcurl?
1039libcurl has excellent support for transferring multiple files. You should
1040repeatedly set new URLs with `curl_easy_setopt()` and then transfer it with
1041`curl_easy_perform()`. The handle you get from curl_easy_init() is not only
1042reusable, but you are even encouraged to reuse it if you can, as that
1043enables libcurl to use persistent connections.
1045## Does libcurl do Winsock initialization on Win32 systems?
1047Yes, if told to in the `curl_global_init()` call.
1049## Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on Win32 ?
1051Yes, but you cannot open a FILE * and pass the pointer to a DLL and have that
1052DLL use the FILE * (as the DLL and the client application cannot access each
1053others' variable memory areas). If you set `CURLOPT_WRITEDATA` you must also use
1054`CURLOPT_WRITEFUNCTION` as well to set a function that writes the file, even if
1055all it does is write the data to the specified FILE *. Similarly, if you use
1056`CURLOPT_READDATA` you must also specify `CURLOPT_READFUNCTION`.
1058## What about Keep-Alive or persistent connections?
1060curl and libcurl have excellent support for persistent connections when
1061transferring several files from the same server. curl attempts to reuse
1062connections for all URLs specified on the same command line/config file, and
1063libcurl reuses connections for all transfers that are made using the same
1064libcurl handle.
1066When you use the easy interface the connection cache is kept within the easy
1067handle. If you instead use the multi interface, the connection cache is kept
1068within the multi handle and shared among all the easy handles that are used
1069within the same multi handle.
1071## Link errors when building libcurl on Windows
1073You need to make sure that your project, and all the libraries (both static
1074and dynamic) that it links against, are compiled/linked against the same run
1075time library.
1077This is determined by the `/MD`, `/ML`, `/MT` (and their corresponding `/M?d`)
1078options to the command line compiler. `/MD` (linking against `MSVCRT.dll`)
1079seems to be the most commonly used option.
1081When building an application that uses the static libcurl library, you must
1082add `-DCURL_STATICLIB` to your `CFLAGS`. Otherwise the linker looks for
1083dynamic import symbols. If you are using Visual Studio, you need to instead
1084add `CURL_STATICLIB` in the "Preprocessor Definitions" section.
1086If you get a linker error like `unknown symbol __imp__curl_easy_init ...` you
1087have linked against the wrong (static) library. If you want to use the
1088libcurl.dll and import lib, you do not need any extra `CFLAGS`, but use one of
1089the import libraries below. These are the libraries produced by the various
1090lib/Makefile.* files:
1092| Target | static lib | import lib for DLL |
1093|----------------|----------------|--------------------|
1094| MinGW | `libcurl.a` | `libcurldll.a` |
1095| MSVC (release) | `libcurl.lib` | `libcurl_imp.lib` |
1096| MSVC (debug) | `libcurld.lib` | `libcurld_imp.lib` |
1098## libcurl.so.X: open failed: No such file or directory
1100This is an error message you might get when you try to run a program linked
1101with a shared version of libcurl and your runtime linker (`ld.so`) could not
1102find the shared library named `libcurl.so.X`. (Where X is the number of the
1103current libcurl ABI, typically 3 or 4).
1105You need to make sure that `ld.so` finds `libcurl.so.X`. You can do that
1106multiple ways, and it differs somewhat between different operating systems.
1107They are usually:
1109* Add an option to the linker command line that specify the hard-coded path
1110 the runtime linker should check for the lib (usually `-R`)
1111* Set an environment variable (`LD_LIBRARY_PATH` for example) where `ld.so`
1112 should check for libs
1113* Adjust the system's config to check for libs in the directory where you have
1114 put the library (like Linux's `/etc/ld.so.conf`)
1116`man ld.so` and `man ld` tells you more details
1118## How does libcurl resolve hostnames?
1120libcurl supports a large number of name resolve functions. One of them is
1121picked at build-time and used unconditionally. Thus, if you want to change
1122name resolver function you must rebuild libcurl and tell it to use
1123a different function.
1125### The non-IPv6 resolver
1127The non-IPv6 resolver that can use one of four different hostname resolve
1128calls depending on what your system supports:
11301. gethostbyname()
11312. gethostbyname_r() with 3 arguments
11323. gethostbyname_r() with 5 arguments
11334. gethostbyname_r() with 6 arguments
1135### The IPv6 resolver
1137Uses getaddrinfo()
1139### The cares resolver
1141The c-ares based name resolver that uses the c-ares library for resolves.
1142Using this offers asynchronous name resolves.
1144## The threaded resolver
1146It uses the IPv6 or the non-IPv6 resolver solution in a temporary thread.
1148## How do I prevent libcurl from writing the response to stdout?
1150libcurl provides a default built-in write function that writes received data
1151to stdout. Set the `CURLOPT_WRITEFUNCTION` to receive the data, or possibly
1152set `CURLOPT_WRITEDATA` to a different FILE * handle.
1154## How do I make libcurl not receive the whole HTTP response?
1156You make the write callback (or progress callback) return an error and libcurl
1157then aborts the transfer.
1159## Can I make libcurl fake or hide my real IP address?
1161No. libcurl operates on a higher level. Besides, faking IP address would
1162imply sending IP packets with a made-up source address, and then you normally
1163get a problem with receiving the packet sent back as they would then not be
1164routed to you.
1166If you use a proxy to access remote sites, the sites do not see your local
1167IP address but instead the address of the proxy.
1169Also note that on many networks NATs or other IP-munging techniques are used
1170that makes you see and use a different IP address locally than what the remote
1171server is seeing you coming from. You may also consider using
1172[Tor](https://www.torproject.org/).
1174## How do I stop an ongoing transfer?
1176With the easy interface you make sure to return the correct error code from
1177one of the callbacks, but none of them are instant. There is no function you
1178can call from another thread or similar that stops it immediately.
1179Instead, you need to make sure that one of the callbacks you use returns an
1180appropriate value that stops the transfer. Suitable callbacks that you can
1181do this with include the progress callback, the read callback and the write
1182callback.
1184If you are using the multi interface, you can also stop a transfer by removing
1185the particular easy handle from the multi stack at any moment you think the
1186transfer is done or when you wish to abort the transfer.
1188## Using C++ non-static functions for callbacks?
1190libcurl is a C library, it does not know anything about C++ member functions.
1192You can overcome this limitation with relative ease using a static member
1193function that is passed a pointer to the class:
1195~~~c++
1196// f is the pointer to your object.
1197static size_t YourClass::func(char *buffer, size_t sz, size_t n, void *f)
1199 // Call non-static member function.
1200 static_cast<YourClass*>(f)->nonStaticFunction();
1203// This is how you pass pointer to the static function:
1204curl_easy_setopt(hcurl, CURLOPT_WRITEFUNCTION, YourClass::func);
1205curl_easy_setopt(hcurl, CURLOPT_WRITEDATA, this);
1206~~~
1208## How do I get an FTP directory listing?
1210If you end the FTP URL you request with a slash, libcurl provides you with
1211a directory listing of that given directory. You can also set
1212`CURLOPT_CUSTOMREQUEST` to alter what exact listing command libcurl would use
1213to list the files.
1215The follow-up question tends to be how is a program supposed to parse the
1216directory listing. How does it know what's a file and what's a directory and
1217what's a symlink etc. If the FTP server supports the `MLSD` command then it
1218returns data in a machine-readable format that can be parsed for type. The
1219types are specified by RFC 3659 section 7.5.1. If `MLSD` is not supported then
1220you have to work with what you are given. The `LIST` output format is entirely
1221at the server's own liking and the `NLST` output does not reveal any types and
1222in many cases does not even include all the directory entries. Also, both
1223`LIST` and `NLST` tend to hide Unix-style hidden files (those that start with
1224a dot) by default so you need to do `LIST -a` or similar to see them.
1226Example - List only directories. `ftp.funet.fi` supports `MLSD` and
1227`ftp.kernel.org` does not:
1229 curl -s ftp.funet.fi/pub/ -X MLSD | \
1230 perl -lne 'print if s/(?:^|;)type=dir;[^ ]+ (.+)$/$1/'
1232 curl -s ftp.kernel.org/pub/linux/kernel/ | \
1233 perl -lne 'print if s/^d[-rwx]{9}(?: +[^ ]+){7} (.+)$/$1/'
1235If you need to parse LIST output, libcurl provides the ability to specify a
1236wildcard to download multiple files from an FTP directory.
1238## I want a different time-out
1240Sometimes users realize that `CURLOPT_TIMEOUT` and `CURLOPT_CONNECTTIMEOUT`
1241are not sufficiently advanced or flexible to cover all the various use cases
1242and scenarios applications end up with.
1244libcurl offers many more ways to time-out operations. A common alternative is
1245to use the `CURLOPT_LOW_SPEED_LIMIT` and `CURLOPT_LOW_SPEED_TIME` options to
1246specify the lowest possible speed to accept before to consider the transfer
1247timed out.
1249The most flexible way is by writing your own time-out logic and using
1250`CURLOPT_XFERINFOFUNCTION` (perhaps in combination with other callbacks) and
1251use that to figure out exactly when the right condition is met when the
1252transfer should get stopped.
1254## Can I write a server with libcurl?
1256No. libcurl offers no functions or building blocks to build any kind of
1257Internet protocol server. libcurl is only a client-side library. For server
1258libraries, you need to continue your search elsewhere but there exist many
1259good open source ones out there for most protocols you could want a server
1260for. There are also really good stand-alone servers that have been tested and
1261proven for many years. There is no need for you to reinvent them.
1263## Does libcurl use threads?
1265No, libcurl executes in the same thread you call it in. All callbacks are
1266called in the same thread as the one you call libcurl in.
1268If you want to avoid your thread to be blocked by the libcurl call, you make
1269sure you use the non-blocking multi API which does transfers
1270asynchronously - still in the same single thread.
1272libcurl does potentially internally use threads for name resolving, if it was
1273built to work like that, but in those cases it creates the child threads by
1274itself and they are only used and then killed internally by libcurl and never
1275exposed to the outside.
1277# License
1279curl and libcurl are released under an MIT/X derivative license. The license
1280is liberal and should not impose a problem for your project. This section is a
1281brief summary for the cases we get the most questions.
1283We are not lawyers and this is not legal advice. You should probably consult
1284one if you want true and accurate legal insights without our prejudice. Note
1285especially that this section concerns the libcurl license only; compiling in
1286features of libcurl that depend on other libraries (e.g. OpenSSL) may affect
1287the licensing obligations of your application.
1289## I have a GPL program, can I use the libcurl library?
1291Yes
1293Since libcurl may be distributed under the MIT/X derivative license, it can be
1294used together with GPL in any software.
1296## I have a closed-source program, can I use the libcurl library?
1298Yes
1300libcurl does not put any restrictions on the program that uses the library.
1302## I have a BSD licensed program, can I use the libcurl library?
1304Yes
1306libcurl does not put any restrictions on the program that uses the library.
1308## I have a program that uses LGPL libraries, can I use libcurl?
1310Yes
1312The LGPL license does not clash with other licenses.
1314## Can I modify curl/libcurl for my program and keep the changes secret?
1316Yes
1318The MIT/X derivative license practically allows you to do almost anything with
1319the sources, on the condition that the copyright texts in the sources are left
1320intact.
1322## Can you please change the curl/libcurl license?
1324No.
1326We have carefully picked this license after years of development and
1327discussions and a large amount of people have contributed with source code
1328knowing that this is the license we use. This license puts the restrictions we
1329want on curl/libcurl and it does not spread to other programs or libraries
1330that use it. It should be possible for everyone to use libcurl or curl in
1331their projects, no matter what license they already have in use.
1333## What are my obligations when using libcurl in my commercial apps?
1335Next to none. All you need to adhere to is the MIT-style license (stated in
1336the COPYING file) which says you have to include the copyright notice in *all
1337copies* and that you may not use the copyright holder's name when promoting
1338your software.
1340You do not have to release any of your source code.
1342You do not have to reveal or make public any changes to the libcurl source
1343code.
1345You do not have to broadcast to the world that you are using libcurl within
1346your app.
1348All we ask is that you disclose *the copyright notice and this permission
1349notice* somewhere. Most probably like in the documentation or in the section
1350where other third party dependencies already are mentioned and acknowledged.
1352As can be seen [here](https://curl.se/docs/companies.html) and elsewhere, more
1353and more companies are discovering the power of libcurl and take advantage of
1354it even in commercial environments.
1356## What license does curl use exactly?
1358curl is released under an [MIT derivative
1359license](https://curl.se/docs/copyright.html). It is similar but not identical
1360to the MIT license.
1362The difference is considered big enough to make SPDX list it under its own
1363identifier: [curl](https://spdx.org/licenses/curl.html).
1365The changes done to the license that make it uniquely curl were tiny and
1366well-intended, but the reasons for them have been forgotten and we strongly
1367discourage others from doing the same thing.
1369# PHP/CURL
1371## What is PHP/CURL?
1373The module for PHP that makes it possible for PHP programs to access curl
1374functions from within PHP.
1376In the curl project we call this module PHP/CURL to differentiate it from curl
1377the command line tool and libcurl the library. The PHP team however does not
1378refer to it like this (for unknown reasons). They call it plain CURL (often
1379using all caps) or sometimes ext/curl, but both cause much confusion to users
1380which in turn gives us a higher question load.
1382## Who wrote PHP/CURL?
1384PHP/CURL was initially written by Sterling Hughes.
1386## Can I perform multiple requests using the same handle?
1388Yes.
1390After a transfer, you set new options in the handle and make another transfer.
1391This makes libcurl reuse the same connection if it can.
1393## Does PHP/CURL have dependencies?
1395PHP/CURL is a module that comes with the regular PHP package. It depends on
1396and uses libcurl, so you need to have libcurl installed properly before
1397PHP/CURL can be used.
1399# Development
1401## Why does curl use C89?
1403As with everything in curl, there is a history and we keep using what we have
1404used before until someone brings up the subject and argues for and works on
1405changing it.
1407We started out using C89 in the 1990s because that was the only way to write a
1408truly portable C program and have it run as widely as possible. C89 was for a
1409long time even necessary to make things work on otherwise considered modern
1410platforms such as Windows. Today, we do not really know how many users that
1411still require the use of a C89 compiler.
1413We continue to use C89 for as long as nobody brings up a strong enough reason
1414for us to change our minds. The core developers of the project do not feel
1415restricted by this and we are not convinced that going C99 offers us enough
1416of a benefit to warrant the risk of cutting off a share of users.
1418## Would curl be rewritten?
1420In one go: no. Little by little over time? Sure.
1422Over the years, new languages and clever operating environments come and go.
1423Every now and then the urge apparently arises to request that we rewrite curl
1424in another language.
1426Some the most important properties in curl are maintaining the API and ABI for
1427libcurl and keeping the behavior for the command line tool. As long as we can
1428do that, everything else is up for discussion. To maintain the ABI, we
1429probably have to maintain a certain amount of code in C, and to remain rock
1430stable, we never risk anything by rewriting a lot of things in one go.
1431That said, we can certainly offer more and more optional backends written in
1432other languages, as long as those backends can be plugged in at build-time.
1433Backends can be written in any language, but should probably provide APIs
1434usable from C to ease integration and transition.
Diagnostics4 git calls · 33 ms
CallStatusSizeTime033 ms
discover200152 B4 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit3 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=3
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit4 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=25
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=4
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch20024 KiB · hit25 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=24860
git.response.cache=HIT
git.response.duration_ms=25
git.fetch.wants=b23edbc24055715216eae50b4cdfebebfbf624d6
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=24860
git.pkt.payload.max=24839
git.sideband.band1.bytes=24838
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e18339cd5a3014
Request
cb66ec19…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format