uh hi everyone uh i'm looking into the screen here talking to you um so how to curl better uh first i just wanted them to let you know that i am daniel steinberg of course i founded carl back in 1998 i'm still the lead developer and i do curl development full time every day these days i'm employed by wolf ssl we sell commercial curl support for those who want it i've been doing this for a long time and i figured this would be a fun time for me to just share some tricks and tips about
how to do curl and i'm sure that a lot of you know what curl is and what it isn't and what to do and but i'm going to tell you anyway to sort of get everyone on board and and i'm sure that it can be some tidbits for everyone so first a little bit of a roundup here what curly is what it isn't and how how how it come to be the way it is for everyone because it's different for everyone and why is that right and then i'm going to run over a bunch of
different options a little bit how to and why they exist as they are and what options to not use so much perhaps and why so and then of course a little q a in the end so if you have questions really about anything carl but possibly about what i'm going to talk about so go ahead and fill them in into the uh question thing that you want is running here so and i will get to them in the end i my plan is here to not to talk for a completely long time but maybe 30
40 minutes and then we can have discussion on questions and answers and then then i'm going to be out of your face and you can go on and do whatever you want okay so curl done just to get everyone on board here is an open source project we do a command line tool and we do a library we transfer data into well we actually do internet transfers right we specify the transfers as urls that's why the url in the name carl can do a lot of things supports 24 different transfer protocols and a busload of
features and here are some of them that are sort of just packed on one screen we can ignore that for now but we can just agree that curl is sort of a swiss army knife for internet transfers it can do a lot of things and i'm going to get into some of those things today and explain a little bit about concepts and everything but first who makes curl and what how how did it end up like this or how how is it like this like now so curly is pretty much the result of 2200 contributors
having helped out over the years and helping out means basically anything writing docs reporting bugs coming with code uh stuff like that and where about 70 authors who've written code merch into the git repository about 150 of these or authors write something per year and we're about 12 10 12 people that actually do 10 commits or more per year and we're basically me doing that every year for the 22 years now so a lot of people involved so it's it's i might be sort of the captain on the boat but i'm certainly not alone in
this venture so curl has to some extent already sort of conquered the world and the image here on the right is the nasdaq building in new york with a fancy curl command line on the big screen there so but how how come it conquered how how come we've been sort of successful within air quotes so far but we sort of created curl at the right time before or in the beginning of the sort of internet boost in the i started my first hp stuff in 1996 the first curl version came in 1998 and then we
sort of surfed on the internet big internet wave and it's been open source everyone can run it everywhere and it's really really portable so you can run it on whatever operating system or platform you want and of course it is also backwards compatible that means that it's easy for everyone to write something depend on it and it'll just keep on working you can upgrade your scripts and upgrade your curl over the years and it'll work the same way and and you can be sure of that and it's also a very stable product so all of
this makes it very easy for everyone to rely on curl and use curl for whatever you want so and it also doesn't exist in many places we started in 98 it shipped ships actually still ships in mac os since 2001 it's been in it's uh in the stock windows 10 since 2018 it's been in it's in every linux distribution since for this long time the first linux yesterday added it in 99 and of course it's available in all the other operating systems too and if not you can build it from source and a lot of
people also build it from source anyway for various reasons and it also exists in a lot of different flavors right so there are millions literally millions probably billions of bill combinations you can select uh on and off among roughly 30 different third dependencies like tls libraries libraries for ssh libraries for compassion libraries for a lot of different things so any random place you find curl you you may find that they've selected a different set of third-party dependencies that they built curl with and then it ends up differently and we also have very frequent releases we
do releases every second months basically so given given time and different distributions different third-party and you will also see different versions of carl wherever you use card basically it's very rarely the same in two places it also supports as i mentioned before a lot of protocols and options and today i'm only going to i'm going to stick to talk about curl the command line tool and not the library curl library lib curl is a is vastly used by applications and devices and everything who wants to build internet transfer powers into their tools or or devices
but i'm going to talk about the command line to curl hill you know the one you've seen in the prompt or running your scripts it knows a lot of protocols 24 transfer protocols as i mentioned but there are some other protocols of course under the hood but today i'm going to talk about um specifically one protocol and of course since curl supports all these different protocols all these different features it has a lot of command line options 230 of them as we speak the 231st option is being added and will be included in the next
release so we're constantly adding new options to the command line to a lot of them as you can imagine so i'm not going to talk about all of them today of course i'm going to talk about http and hbs in this presentation i'm going to limit my explanations to a subset of the options to sort of some of the important ones some of the cool ones maybe some other ones you didn't really know and and care about before so i wanted to show you this little graph i made the other day this shows the number
of command line options over time in the current project so we started out with 24 options come online options back in 1998 and we are now at 230 231 in the month so yes yeah growing fast okay but we're talking about http and https today so what is hp hp is a simple protocol you've seen it a lot of times you know it what it is basically here here's you and there's the server um and what do we and what do we do with that right we send a request to the server we send a
method in the path we send headers and possibly a body and we get that back from the server right response response code we get headers and body that is http and it looks like this if you look at it from a more protocol dump way you know here's a request with some headers and here's a response then with the response code at the top the 200 there and headers and content that's the body you've seen it this is the same thing it basically has looked like this since in the mid 90s it looked very similar
before the mid 90s too but http 1.0 introduced this look basically and that came 1996. so anyway that's that's uh that's hp then curl is minimal behavior by default i call it or i like to call it the list so that means that um it does only what it has to do and nothing else by default so there's a basic set of headers and there's no fancy functionality so you have to if you want to want it to do something more than just the basic stuff you add that option and you tell it to do
the other things and basically all the options that add things or ask curl to do anything they're on and off so you if you want to add two different things you have to do with two different options and you can turn them on and off individually which means that you you have a really fine grain control exactly what curl will do and understand and not do on and off if you just want the basic stuff you don't tell it to do it if you want it fancy you ask for it and of course just a
basic command and option thing there are long options and short options and by name right so you could for example use dash s i i will say dash for that minus minus sign in front of s here i call it dash so you can use dash s instead of the longer version called silent and a lot of um options of course um won't have the short option because 230 230 options they're not enough letters in the alphabet to actually have short options for them all but there are showed up there are a lot of short
options i think there's a single letter left for this for short options and then that's a it's a quiz for you to come up with which of the letters aren't used yet but so that's that's the options on how we use it okay a zip coffee here we go so we start out with curl the most simple way you can do it you just ask you want to do a http get that's curl and you enter in this case not even a url this is just a host name right but curl will assume that this
is actually a url so it will transform it to url for you maybe you meant http colon example.com and it'll do that for you and you get the response body on the screen because you didn't tell it where to go so it got just sent to standard out so this is more like how um maybe unix commands are typically sort of usually usually work send everything to stand it out but you can then also get to see the response header so in so in this case we have we now write the full url here https
colon slash example.com and we add the dash i to get the in the headers included in the output so then we get the response code we get headers back and we get the body this is still a get request over http fancy so yep your name you get to see the headers and you get to see the body and of course if you wanted to do something with the body what if you get some fancy content here if you would for example get json you could pipe it into the jq tool jhq being a cool
tool to handle json and it'll show it in in a fancy way like this right instead of just everything on a single line without any new lines in a blurb if you would do this with a image or a movie or a sound clip you would of course not want that on your terminal you wouldn't save that to a file but you can also check the url for example with a head request just ask the server about details of the resource so you ask with a capital i dash capital i and he'll set a head
and you won't get it in body you will only get the response and headers gets just some info use you can see the size the date the server info and whatever and it's the 200 so you know the resource exists and there's no body because header doesn't return a body it never does okay easy peasy just the two simple little things um and and again curl only does what you ask it for so it does everything as basic as possible until you ask for something more so if you for example do like this you wanna
you query uh you a resource that's redirected redirected being it should be lingua then for it should actually ask for another resource rather than this this has moved or you want to go to the other place so if you ask you ask for head here you get the content you get the 302 which means the redirect one redirect kind there are several different kinds but we can and it says a ign which actually is done the pointer to the new place but uh yeah and there's no body but curl won't go there you will still
just get this because you haven't asked curl to follow the redirect just you just basically investigated the sign here you didn't follow the sign so instead if you wanted to actually follow the request you would ask you would add the in this case the dash capital l which is then asks it asks carl to follow the redirect and then you would get both first the redirect code and then it'll follow the redirect and you will get the sort of the final destination and it would actually follow a lot of redirects here if you if it
if this would be redirected several steps it would follow all the steps um which could be a lot of them and it has a loop detection so it'll actually stop after a certain amount of redirects so we want to do it infinitely so this is how it works done right so you have to ask for everything to enable it otherwise it won't do it another little fancy thing that that is sometimes forgot forgotten about with curl is that it supports what we call all right no body and what we call url globbing which is a
feature that some shells provide on their own but some don't and curl supports it natively so you can for example get a range of documents like this automatically uh one two nine here all those webpages in one go and it'll send them in this case also standard out which is probably not what you want or you can get everything with a zero prefixed one two ninety nine zero prefixed or you can get a to z in an alphabetical range like this and you can even do more advanced stuff you can sep stem take every other
step from one to nine so it'll just step by two and step step by one one by one or you can do that with letters as do these steps three letters at a time and in in case you don't want this say to sort of sent to standard out or the terminal but which you rarely want right so you can save them like this and this is a fancy thing so you can see here the the pound sign um the hashtag in the in the option here is this for the saving so it'll actually get
that parameter from the range in the url it'll be the first range will then be put there so this will save files save underscore one dot html save underscore two dodge dot html send save underscore three dot html and so on and you can also do comma separated and strings like this so it'll get this different ham cheese and pineapple images and save them um as jpegs like this and of course you can combine everything in one command line if you want to so you can ask for both ranges of different kinds and these separated
comma separate the lists and you could of course say that in different output files too so you could it could end up in a really large amount of transfers if you want to sometimes when you you do all this fancy stuff with curl you will find yourself in a position where curl doesn't do exactly what you want and you're wondering why doesn't it work what should i do to fix my command line so then you add this dash v and it'll show you a lot of details v for verbose of course it's actually dash dash
verbose if you do it in the long version and it'll tell you about things like ip addresses protocol details tls details and then you will also see the actual request going out you won't actually see the request body in this case but but a lot of details and then you will get the headers back and you will get the body as um well in this case the command line saves the body to dev knowledge you won't see it but always remember the hv is a is a key to to solving your issues you that helps
you see what is getting sent hope you understand what's wrong when right with your command line and when that is not enough you don't add more v's i know some unix tools and linux tools then you know you can add more v's to get more verbose and a lot of people then add more beads like vvv or whatever but it would curl that doesn't change anything you can have as many of these as you want but it won't change anything you won't get more data so what you want to do instead is is i'll show
you later because there there's more tricks to getting more info but i just wanted to say other a few other ways to extend your hp request is when you want to add provide custom http headers in your request maybe you want to send a magic disco header in your request or you want to set a special user agent in your request because let's be honest some servers will deny your request if it sees that this curl but you can say at your disco in the night and then you might get your response back and you
can even remove the the user agent header completely by by doing it like this without having any right side of the colon it'll remove the header from the request and you can do this little magic thing by putting a semicolon there it'll send a blank feel for this header in the request so you can sort of this way you can handicraft your request to look exactly the way you want or mimic another client browser whatever you want to do if you want to post basic data like for example you want to send an update to
web page or login or anything in this case for example i want to send my name is daniel to this server i just put it with dash d and it makes a simple post to that server and you get a response and everything's back in this case we have the dash i so we get a get the headers back on the terminal and we get the content too because we didn't send the content anyway we can post a file which just we just prefixed it with a add sign so add file name and it'll send
that as a post we can post from a standard input so just pipe whatever and we post within at dash and it'll post the standard input instead or we can ask carl to treat the files binaries that don't ignore new lines or anything and just send it exactly as is or we can use that and send a binary from a file as well and we can add a header custom header like in this case if you want to send json sometimes you want to tell the server that it is actually json coming in the post
then you can do it like that um and then when people start doing things like this you often want to do for example you also want to do post is one way to send data to hp server put is another put is usually a way to sort of replace instead of sending data to a resources you it's actually more meant to replace a resource with this content so they they're similar but slightly different in semantics but then you do it like this anyway you just use the uppercase t and you put a local file like
this and it'll push and in this case we're dash i again so we get the response headers and we get response body because we didn't save it and if we're not happy with post and put them get the head we can change the method we send to the server with with the capital x option so we so we do that this time so we want to send a put but we want to change the http method so we send it as a swoosh instead like this easy pc but here's here's the key here the dash
x should be used sparingly and only for the cases where you really want to use something else than what curl can do by itself so you shouldn't it's a little bit tricky thing to use there so i'm going to explain why so using capital x too much can lead to pain um so for example here's the here's the typical case that we see a lot of people this is one of the most abused uh command line cases in the uh on the internet you want to post something here like post data you send it to
this site and we add this dash capital x here for for no good reason because this will do a post anyway without us saying so like that we don't need that right so then we do like this oh we want to follow a redirect as well so we add this dash capital l at the end we want to follow the redirect that we get back from this post but this is probably not what you want and this is a very common mistake because now it'll send post in the when following the redirect as well which
in often cases this wouldn't do otherwise so um basically avoid it so it means that capital x means that you'll use that in all requests even when it follows redirects otherwise the redirect code will tell carl what method to use and dash x will override that and you will be sorry and unhappy and it'll not work the way you want to so only use dash capital x if it uses if you want a different method than curl would use itself to put shortly and and just briefly and just remember this avoid it don't use dash
capital x unless you really have to but you very rarely have to so okay going further and faster into cookies cookies are just headers really and we already seen how we can add headers and in requests but cookies are more sort of advanced headers so they're really name value pairs we send in headers or we get them from a server we can send them back from a client if it matches sort of conditions like a name and path parts and everything and again curl doesn't know about cookies unless you ask girl to know about cookies
and then it works like this you for example um all right first i wanted to mention that yeah you need you actually have separate options for reading cookies from a file and writing cookies to a file and sort of saving cookies after a session so you would do like this uh here's here's a final example save all the cookies from this site so you would ask you would request a page from this site any cookie you get back or cookies number cookies it'll save in the cookie jar and then you could for example do another
request to the same site and read back the cookies that you saved in the previous invoke and it'll use send those cookies back exactly like your browser would or any other sap web client would do and so and you could use both of them at the same in the same command line and it'll it'll work with cookies and here's an example i just wanted to show you roughly how such a cookie jar would look like this is just a very basic simple fake cookie it would look like this it doesn't really matter what all the
fields means but i just wanted to show you that there's a text file with the contents with the cookie the contents of the cookie jar so okay and in a typical login case if you wanted to like how you log into a website with a browser if you would do that with girl you would typically combine a post and saving cookies so then you would do like this you would save cookies for example when you go to the login form of a special site your own favorite site and on that login form maybe you want
to provide your username and password and you want to make sure that you use the cookies and you save the updated cookies and in this case bam if you get logged in by that request you can in your third request here actually request data and that's on that site as a logged in user this is sort of just the basic steps how how most modern websites actually work these days you log in with a post and you keep keep session as a cookie it'll be slightly more complicated sometimes when the sites uses a lot of
javascript and other things that ruins your day but okay this is the basic concept at least and today of course as i mentioned or seen or everybody knows we're using https right for everything these days so you want to try to get stuff from your own site with https instead of http but then you run into problems right if you do it like this if you try to get a web page from your local host for example you will see that you have certificate problems because your site on your local host won't have um you
don't have the circuit certificate for for this ip address right so it won't work to do like this so then you can ask carl to ignore the certificates checks if you want to but uh we don't condone that and it's uh it doesn't work for cookies either so if your host actually is named something it doesn't work when you access it with the wrong name then you can do like this you can provide a host header to the site and then then this actually makes it work with cookies but it doesn't work with virtual servers
because virtual servers when you do it with tls you want it to have the proper server name in the uh already in the tls handshake and this doesn't so it doesn't work for that either so curl has another way to do it and this is the fancy way to so you add the dash dash resolve this is basically a way to provide the an ip address for a host name that you make up or rather you provide the ip address for whatever host name you want like this if you want to you want to access
example.com on your own host because you run your own you want to have your run your own copy of the example.com server on your localhost you can just tell carl that this is the ip address for example.com right now so this makes it work with the with tls and certificates and it works with cookies and it works will it it works even if you have virtual setup so if you run more than one server on your localhost it'll work for that too it's a pretty convenient way you can even there's also another option that called
connect to which is slightly different but achieves almost the same thing mostly so here you can actually tell carl to connect to another host name instead of the original host name and even change port number if you want to so you can do a lot of tricks if you want to access a server on a temporary site like when you develop the site or when you want to test just one particular load balancer perhaps out of a set of many so you you know where to go and you don't want to use the ordinary dns
round robin or whatever it does so okay you can do a lot of fancy things so let's see other fancy things oh right let's just pause and say don't use dash k to disable certificate checks and no avoid it so you want to do get more details out of your command line carl tool so then i mentioned before how using more vs in the verbose option doesn't help you because it won't add more data so instead curl provides the this option called trace ascii there's also actually one called just dash trace they're similar and they
add a lot more detail they basically send everything they show you everything that curl sends in and out sends out and gets in um so it'll help you identify exactly what is going on so like in this case you can see this is a simple post sent to this server example.com and then you can see like this um exactly what kind of request looks like what kind of data it sounds that it sends the exact send this data as a post down there you see the third line from the bottom you can see the post
data getting set out and of course this is a simple case but in more complicated cases you'll you can verify that the post or the request looks exactly the way you want it and intended it to be and you can see every single byte that curl gets back to and you can verify that it actually is it matches whatever you think it should look like other ways to extract sort of information from your request or transfers when you use kirk the command line tool is the funny write out option dash w so you use it
like this it says a string with a bunch of variables for you to get data out of curl with so you use it like this basically write out and then it's a text and you have variables in there to use and you have fancy and fun variables there's a whole range of i think there's around 30 different ones so far you can get content type you get a hp version remote ip address local ip address you can download speed and we're introducing the the json variable that i know a lot of people are looking forward
to which will output all of these variables as a json object so soon you will get everything as a json object so to information is not actually data from the transfer but it's information about the most recent transfer like this you would use write out json like this uh dash w and this percent brace json brace which is a way of just specifying that we want that variable output and it sends the variable output to standard out here so we save the actual file to the with o we save it to file on disk and
we pass this in this case to jq again because jq is a cool json tool and it'll look like this maybe not color coded like this but anyway it'll pretty print it that's jq doing it and so there's this is json coming from curl with metadata about the particular transfer from that url right now nice right so running forward run so what if you do all of this and you're thinking well i want to do a tool of this instead instead of running my command lines i want to write a lib curl using tool that
does the same thing and then curl has the fun command line one of my favorite command line options to curl is the dash dash lib curl option uh so you use it like this you write the curl command line whatever color command line you can think of really you add all the options and then you add the stash leave curl and the source code.c and curl will then generate that source code and then you compile that source code and you run it and it'll that ex that application will then perform the same operation as your
command line did like this if you if in this example if you would do that just getting that example.com url it would generate a source code that looks roughly like this it's a template it dude it does the transfer in this case a very simple transfer and it doesn't add anything magic but that's the that's the header that's the source code for it and you could just build it immediately and run it and you have your own libcard using application and it's a really good kickstart because whatever you want to do of course you don't
i mean you want to do something slightly more advanced than this possibly but this is a really good way to get going get started with your lip color using application and of course and there's a slightly advanced whatever you want to do like with you you a lot of use cases come from you know your you sit somewhere with your browser you've done something you want to make sure that you can redo that operation with curl after you've done it the same way the browser would do it like log into that site or download that
file or view that image and then all browsers nowadays firefox chrome edge and sephora they all have this copy as curl option these are three different screenshots they're fairly old by now but so it basically probably looks a little bit different these days in all of them but all of the major browsers they have this copy scroll option in their networking debug tool so if you go into this debug tools section of the browser and you can see all the different requests for a website and you can select one of those lines and you can
go into that right click it and select copy as curl and then you get um then you get a command line copied to your clipboard for a command line that would use curl to get that request exactly the way the browser would do it basically like this bam here's an example of firefox doing a request and as an example actually actually this uh it gets the curl front webpage and the exact same web page from from chrome it looks like this uh they they're they're long and a bit overly complicated but this is because it
sets the exact same header set that the browsers are using anyway that's the way it works so if you have a command line if you have a request you want to mimic with curl from the browser it's an easy way to get started and of course after you do this you usually go through this list of options and trim it a little bit and make sure that it actually does exactly what you want to and not the way you got it copied from the beginning so it's the first step it's not the final step and
if that's not enough you can do like this you can do enter the ssl key log file way of spying on your browser or spying on curl and making sure that everything looks the same especially if you for example want to mimic several steps of operations that your browser does and you want to make sure that curl does the same thing maybe then you can snoop on them and make sure that and verify that they look and behave the same right so you just need these things you need y-shirt and you need this environment variable
called ssl key log file all in uppercase no spaces and you tell both well like this you specify to why shark where to load tls secrets and ssl keylog file tells the tools where to store the secrets so basically they should point to the same file and curl and your browser can save those secrets in that file and make sure that while shark uses it like this you set the environment variable to perth path name like perhaps like this tls key i just made out the path here you can use whatever path you want and
then you run curl so and that of course isn't doesn't help you right but then um you need to have y sharp fired up next to that and then in wireshark you go into this pre master secret log file setting which is under the ssl um protocol section and then you so that tell wireshark read your secrets from here and when you do that you can then enable wireshark to snoop on the network traffic and it will automatically um decrypt and analyze the tls traffic for you even if it's completely i mean it's tls so
it's no longer encrypted and hidden from wireshark so you can actually see the protocol stuff in detail in this case the screenshot here is an http 2 transfer um well a lot of it should be two frames just showing off how it looks like when you analyze tls traffic and you can do that with curl and you can do that with uh with the browser both firefox and chrome support that as well keylog style okay and and um of course curl supports a lot of different protocols then we talk about http here but curl also
supports a lot of different http protocols hdp 1.0 shipped in 96 as i mentioned before headers look that way we learned how headers looked like back in the 90s and then well in 2015 we shipped http 2 and http 2 sends uh headers slightly differently but we we like to pretend that it doesn't incur so even though there's there are now different hp protocols http 3 is coming karl supports it in an experimental way now curl still pretends that all headers look and work like they did in hp one at once or 1.0 so all
headers will appear as they've always done so whatever you tell carl to use http versions if you ask it to use the 1.0 1.1 2 or 3 the headers will you pass to it and the headers you will get back they'll still look the same way and the actual http version will be sort of you won't really have to bother about that it'll say which version it uses so you will know it but you the headers and everything will look the same pretty transparently so it'll it'll make sure that even if your servers upgrade to
version 2 or version 3 and your curl scripts do as well you still can use the headers the same way as you did your headers 20 years ago http 3 support is experimental it works mostly you should try it out it's fun but it's not the final thing all right and then if you want to do adding even more spice to this if you think you want to do a lot of different things on the same command line and a lot of people do right because if you do it on the same command line we
can reuse a lot of caches reuse connections and everything like in this example here we can send the same post to do to two different urls send user the user is daniel to both these urls but maybe i want to send a post first and then a get from another url and then i could do it like this i add the dash next option in between which will which will pretty much reset the command line option parser and go back to the default so in this particular example we're looking at on here on the screen
we first send a post to this to the example.com domain reset all the command options and then we have a get to the next one because that's the default uh method we can also sort of reverse the option and do get first and do the dash dash next and then we send a post to the second url and of course there's no limit to the number of urls or next that you can use so you can um use that a lot if you want to or feel the need to and then of course since it
doesn't quit here in between it'll reuse connections and caches and everything it'll be much faster than doing multiple commandant new books so and by this i hope that i've sort of teased your imagination a little bit about what to do with curl and how to figure out how to do it and use it better and everything uh i realized that i've only sort of touched on what 12 14 18 different options and there are many more many of the options are of course protocol specific so they want to really matter for http but these um
i hope you at least showed you some of them and some of these things was actually new to you and interesting so get in there start using more curl and avoid dash capital x and um don't use dash k either but um try out everything and then of course all that i said here in my little presentation here today all of this and a lot more is also documented and detailed in this little book everything curl which is uh our my attempt to document most of the curl project options and curl command line and everything
in curl really so that's why it's called everything curl so and it's available online in pdf and the and the web version so go read that if you want to dig into all these details even more and of course feel free to help out in the project we always need and appreciate your help to get even better code bug reports patches yelling whatever you think you we need in the project so help out thank you any questions here yeah exactly hi thank you very much for this talk with so many deep insights and tricks we
do actually have quite a lot of questions so let's get to them so the first question is by drew city other situations where it is better or easier to use wget yes there are of course and let me just sidestep that for one second and say that we we we don't have that much of a big of a wget curl war really but it's i like to entertain that notion this feels fun but you know of course i was yeah i would say that wget of course it has this recursive option which is primarily one
that curl really doesn't have so if you want to download one resource that links to other resources like images or style sheets or whatever and you want to get an entire website or whatever then wget is of course your friend and curl will make that really hard for you so that i would say that's the obvious case okay okay great then the next question is how did you decide on the name and the pronunciation of curl uh well so so it of course has a longer history since i started working on yeah i started on
the when i started working with hp client i called it http get from the beginning because i based it on another tool called hp gets uh started off it was i didn't even start it myself so and then it it grew into url get when it got more support than http and then i one day i just thought it supported upload as well and then url get turned out to be a bad name as well because it wasn't only get anymore and then i wanted to i wanted to change the name in one way to
make sure that i didn't have to keep changing it all the time and i wanted it to be short i wanted to have url in the name because it worked with url and then you know names are really hard i came up with url maybe the c could stand for client and it could also see stand for just c as in sort of a fun pun as in see the url um so that's where i went with with curl and of course the pronunciation wise it felt like how else would you pronounce curl it's an
it's actually an english word and you call it curl curly curl so of course it would be pronounced curl that that was easy okay okay great thank you then the next one here is by jesper how do you test curl before releasing it considering all options and build variants oh that's a good question it's really hard i would imagine i would start a preface so we have a huge amount of ci we have a huge amount of test cases and we test a lot of different build combinations and on a lot of different platforms and
tools and everything and of course we we do that to a large extent but no we don't test all combinations and we don't test all possible platforms and we don't so no we do as best as we can but there are of course wide spots that we don't test enough and usually we try to test all the popular combinations on all the popular platforms and hopefully that'll cover it good enough but of course there will always be some gaps that we miss out i think usually we end up in a pretty good place okay then
the next one is does call from windows have all these options isn't it just an alias to some powershell command first curl the project that that i participate in that i found we of course make carl exactly the same on all platforms the curl on windows it actually will work exactly the way it does on all the other platforms so and we've shipped curl on windows for well maybe we didn't do it the first few months but we've done it for almost 22 years and then along when we made curl popular everywhere suddenly one day
microsoft in their infinite wisdom decided that they should create an alias in powershell that's called curl that is almost completely a broken curl it doesn't work like curl but you could make an alias and i don't know why it was never a good idea i've complained to them and i i somebody might know that i also sent them a pull request to remove that alias when they made the code open but they rejected my pull request but but anyway since then since they then they've also uh nowadays they ship the real curl so since uh
march 2018 which i mentioned in my talk here they shipped the real curl not the alias they shipped the alias as well but they shipped the real curl as well so the it's this our code shipped in windows 10 since two years back and that works the same way as curl does everywhere else with the same caveats that they of course have selected a set of dependencies and build options for their particular build so when you run curl on windows 10 it might not works exactly the same as when you do run curl on your
linux distro or something depending on the version and the particular build options they used when they build curl in the microsoft hq okay thank you then if you had the opportunity to restart today would you still have chosen c as your programming language good question it depends over if i wanted curl to become what it is today i would there there wouldn't be any other choice i would say because um uh because of many reasons because curl runs on 17 has run or is running on 72 different operating systems it's run on 20 different cpu
architectures there's just nothing comes even close when when running on these funny new uh computer languages so sure i could rewrite it in rust if i was happy with the three major platforms or maybe five and so on so sure that could have been but if you if i want to if you have if i wanted this 10 billion installations or something that we count on now i would say that c would be mandatory to get that coverage and we have a lot of our users using it in tiny devices on obscure operating systems and
everything so i think c has been one key factor to why curl is as widespread as as it is today so yeah it depends on what i wanted to do if i if i i'm i would stick to c okay and the next one by hendrick does curl support globally set options like the wget rc file for wget yes it does yeah i mean the curl and curl command line tool has a dot curl rc file that it supports for reading options let's start okay great and then frank asks are you a fan of the
dash lol option [Laughter] hi frank uh yes of course i'm a fan so yeah since since curl has a lot of options and also also since you can basically all the letters are used for something you can make up fun sentences by making sure that you just so the lol is one of those fun things i remember one of my my favorite options i think it's a stack overflow option when someone said that the the dash oj is a killer option and i think that's my favorite well for the younger ones in the audience you
might not catch that but still so yeah you can make up really funny and and the the same thing that you know when you add more v's to dash v it doesn't add anything if you add more capital else it doesn't add anything more either so l o l is of course the same as l o uh capital ones so yes you can make a funner funnier um just command lines by adding more letters to it so yes it's a it's a game we have yeah i know frank okay then drew says dash that slip
call is great thanks for the tip and then i have a personal question how do you approach ux of the command line tool with so many options does it grow organically do you sometimes break break backwards compatibility or how do you do that we don't break backwards compatibility which is one of our problems i mean but that's both a blessing and a curse right so it's a blessing for all the users that have something running since 15 years so they don't have to upgrade their scripts it's a bit of a curse when we come up
with or understand that maybe we did it really bad five years ago there wasn't such a good idea to do it that way now we have a much better idea how we would wanted it to be but we can't really remove the old stuff because that's the way it's been working for a while so it's so therefore the ux is not ideal sort of it grows organically and it's grown in a few different ways and and and styles so it's i i think it hurts usability in one way but it then also benefits because it
also it has the great benefit that every all the command lines that ever you worked before they still work so if you actually have you know if i wrote a mailing list post 12 years ago explaining how something worked it still works that way so documentation is really easy to maintain as well right because it's the same thing and we can just add the documentation all the time and we basically don't ever risk that we actually have to go back and find outdated documentation to make sure that we document the new way well we have
a little bit of that anyway but sort of not so much at least so i think it's it's both good and bad okay okay great thanks a lot that was all the questions and thanks again for the great talk i at least learned a lot so okay then take over johann yeah thank you very much to to both daniel and all our viewers and all our sponsors and with that i would like to thank our speakers our sponsors and all our viewers