text
stringlengths
0
2.02k
**Jerod Santo:** Right.
**Daniel Stenberg:** Exactly. I had the opportunity to change the name, change some stuff before I actually carve it in stone and say "Now I'll support this forever?"
**Adam Stacoviak:** And there's an opt-in process for these experimental features, you said?
**Daniel Stenberg:** Yeah, exactly. Then you actually have to explicitly opt in when you build Curl. "I wanna have this enabled in my build."
**Adam Stacoviak:** That's in the Curl config, or that's in the build itself?
**Daniel Stenberg:** Yes, it's in the build itself. HTTP/3 support is still -- you have to actually build it explicitly enabled to get it there.
**Adam Stacoviak:** Gotcha.
**Jerod Santo:** Is that to reduce memory footprint, or bug potential...? Why couldn't I just opt in at runtime, versus at build time?
**Daniel Stenberg:** More of a bug -- I wanna reserve the right to change behavior, or maybe change the name of flags... I'm a little bit concerned that if I enable that by default, someone will run ahead and use that, and then will come back and be upset when I change it. So I wanna make it really -- when I do it expe...
**Jerod Santo:** Gotcha. You want it to be as formal as possible, like a command line flag, \[unintelligible 00:54:57.00\] would be a little bit less formal, and people would be more likely to do that and rely upon it... Whereas if it's like "Actually, you have to build Curl with this experimental flag..." - not very m...
**Daniel Stenberg:** Yeah.
**Jerod Santo:** It makes sense.
**Daniel Stenberg:** But it's a hard -- I have to make some sort of balance there.
**Jerod Santo:** Don't you have some sort of a survey you do as well? I'm thinking of an inbound way; some sort of a conference, or at least a meetup.
**Daniel Stenberg:** That's true. Well, both, actually. I try to do an annual survey, just among users really, where I try to get as many Curl users as possible to respond to and answer... That gives me feedback on what people use, and what they want next, and what they think about things in Curl. So that's actually a ...
\[55:57\] And then we also have an annual Curl developers meetup, which is also a good way to talk to people physically. Not physically these days, but at least talk to people live and see where other Curl developers wanna go, and what they think.
**Jerod Santo:** And that's proven to be well worth your time and effort to put that together?
**Daniel Stenberg:** Yeah, both of them are excellent ways to get feedback, and I think they also work really good as an inspirational source. When you read and learn where people are, and where they wanna go with Curl, I think that's a good inspiration, and it keeps me motivated. Often, they help to bring out new idea...
**Break:** \[56:41\]
**Jerod Santo:** So we'd now like to learn a few things from the Curl master himself - tips and tricks, things you may or may not know about Curl, probably Adam and I will not know about Curl, that Daniel does know about Curl. Lay some on us. Help us improve our Curl-Fu.
**Daniel Stenberg:** Okay. First, of course, I'm going to keep up with what I do; on a lot of forums I say that you should not use capital X and the keyword when you're just doing regular Curl stuff, because Curl does the request verb by default. So if you just type Curl in the URL, it will make a get; you don't have t...
One of my favorite command line options, that so many people don't know about - and it may be not always the most useful, but it's --libcurl. So you make up your fancy Curl command line, do whatever you want, and then you add --libcurl filename.c, and do the same thing again. Then it will generate a template C code for...
**Jerod Santo:** Okay...
**Daniel Stenberg:** Then you just rebuild that linked with libcurl, and you have your own application that does that little thing as a program.
**Jerod Santo:** That is cool. How many languages does that support? Can you do it in Rust?
**Daniel Stenberg:** It supports C... \[laughter\]
**Adam Stacoviak:** It supports C...
**Jerod Santo:** I knew you were gonna say that, but I had to ask anyway. \[laughs\] It supports C...
**Daniel Stenberg:** But the good thing here is that most bindings for libcurl - they use more of less inspired from the API from libcurl itself, so it's usually fairly easy to translate that to all other languages, if you're just using a libcurl binding.
**Jerod Santo:** That's super-cool.
**Daniel Stenberg:** So you could translate it easy to PHP, or PyCurl, or the other bindings.
**Jerod Santo:** Now, why did you develop that one? What made you do that? Maybe because you were debugging somebody else's flags, or something, or...?
**Daniel Stenberg:** \[01:00:04.09\] That question is very common. "I wanna do this in libcurl. How do I do it?" And usually, a lot of users already know how to do it with a command line; they just wanna do that exact translation. And I figured, "Well, Curl knows this, so I could just do the translation." I already do ...
**Jerod Santo:** Yeah, that's cool.
**Daniel Stenberg:** It has actually been very useful many times to just show users and help users to get started.
**Jerod Santo:** Yeah. It sounds like a time-saver for support.
**Daniel Stenberg:** Yeah. Of course, it doesn't actually produce a completely, in all cases, replica, because there are details, but it's usually a very good template to get started with, at least. When you have that, you can get that going, and then you start working from that.
**Adam Stacoviak:** Yeah. Listeners, if you want a link to this - I'm gonna link to your --libcurl chapter in Libcurl Basics, in your book, Dan... Because hey, that's what do you whenever you -- it's TL;DL. Too long, didn't listen. Maybe it's just a link of docs, so I'll link that up in the show notes when we get there...
**Daniel Stenberg:** I like that option.
**Jerod Santo:** Hit us with another one. Do have more?
**Daniel Stenberg:** One thing that I imagine a lot of users already know about, but when you're doing a lot of testing/poking, you wanna know about the -w option, also --write-out. It's a way to extract extra metadata from the previous transfer. So you can, for example, easily extract the HTTP response code, the size ...
So they appear as little variables that you can output in a long string, so when you have 30 different variables that you can output, then that gets output after the transfer is done.
So maybe you'll throw away the output and just output a lot of data from the transfer. If you do that on a cron job on every minute, you can see how the name result times vary over the day, or whatever. A lot of fun things you can extract with that.
**Jerod Santo:** That's pretty cool. What about the data itself? Are there any interpretation tools built in, or modes? I don't think it does JSON parsing... Or will it do anything?
**Daniel Stenberg:** No. I've actually tried to make that as a separation where I draw the line.
**Jerod Santo:** Okay.
**Daniel Stenberg:** Pretty much, Curl delivers the data, or sends the data the other way, but it doesn't actually interpret the data. It doesn't handle the data. You pass that on to something else. You do jq if you have JSON, you have an HTML parser if you wanna parse the HTML... But Curl itself doesn't do that.
**Adam Stacoviak:** It keeps the tool simple, I bet.
**Jerod Santo:** UNIX philosophy, yeah,
**Daniel Stenberg:** It's simpler, and it also makes me more focused. Actually, I think it's a pretty good line in the sand. "This side we can do it, that side where you deal with contents, no. Curl has no idea about what content you're delivering."