Hey man, just want to say as fellow university student that programs in C/C++ every single day, your youtube videos have been gold for bringing some 21st century C knowledge onto youtube. The way you layout your videos and your explanations with clear concise examples allow me to really understand the concepts well and have enough to get going myself. Thank you so much and keep making awesome content!!
@JacobSorber4 жыл бұрын
You're welcome! Glad I could help.
@critic73373 жыл бұрын
Great video - but to any students watching, don't let his rant about "doing it yourself" fool you - 99% of professional developers do not write their own HTTP/FTP/etc. clients for new projects. Using a library for something like this is normal and good, especially one that is as well documented and tested as libcurl.
@fernandoalencar37672 жыл бұрын
Wow super quick and fast for newbies like me to learn.. Of course there are cons and pros to using this library but for beginners in C that are still exploring the language, it’s really amazing!
@srglmr4 жыл бұрын
Your channel is a treasure , thank you
@JacobSorber4 жыл бұрын
Welcome! Glad you're enjoying it.
@marusdod36854 жыл бұрын
if you execute the curl command with the option --libcurl it will dump the source code
@JacobSorber4 жыл бұрын
Oooh...I didn't realize that. Thanks!
@rafalmichalski48934 жыл бұрын
Yes really handy feature
@jimmymontenegro85172 ай бұрын
Gracias, me va a servir mucho para lo que estoy aprendiendo.
@lordadamson3 жыл бұрын
Your videos also serve as references :D Here I am after several months coming back to this video because I'm implementing something that needs libcurl. You sir are awesome :D
@JacobSorber3 жыл бұрын
Thanks, Adam. Glad they're still helpful.
@luismex55754 жыл бұрын
Please make more videos about this... they are great
@rishabhanand42703 жыл бұрын
Okay, so by default any response headers are omitted, that's really handy. Not many people need to read GET 200 OK HTTP/1.1, that is really useful. If you need it, you can use it. That's probably why those functions are having _easy_ in them. Beautiful library.
@ytsgyan2816 Жыл бұрын
Hi Jacob,also, please do mention online tutorial for beginner to advanced lesson of using libcurl in C.
@taskinabdur-rahman34872 жыл бұрын
This channel is incredible. Great work keep it up!
@jasonzurlo15433 жыл бұрын
How do you get the curl library? I went on the website, but I can only find an executable curl program.
@user-ej7ss8ei2g3 жыл бұрын
I love your videos so much, seriously. Your list and queue videos are really fun as well. libcurl has got to be one of the most messy or perhaps OVERLY abstracted APIs ever. It just ends up super non-intuitive to me.
@JacobSorber3 жыл бұрын
Not as "easy" as you would like? 😀 Thanks for the support.
@AntonioAstorino3 жыл бұрын
I pushed the "like" button at 1:07 - LOL
@banshiaryal76204 жыл бұрын
Great work as usual. Your videos are so helpful. Would you mind syncing your content over on LBRY? Trying to stay away from KZbin.
@rafalmichalski48934 жыл бұрын
Nice video Jacob as always. I have question could you make video based on curl to show how to use some example REST API with post / get / put methods ?
@JacobSorber4 жыл бұрын
Sure. I'll add it to the future video topic list.
@deepakmbirajdar47163 жыл бұрын
@@JacobSorber Is this available? and please let us know how to get status code.
@JacobSorber3 жыл бұрын
@@deepakmbirajdar4716 Is the source code available? Yes, through Patreon. And, by "status code" do you mean the HTTP status code?
@deepakmbirajdar47163 жыл бұрын
@@JacobSorber yup
@comprehensivemuskrat4 жыл бұрын
When you’re writing a callback or interacting with a callback heavy library, what’s a fast way to find the callback signature and make sure you’re getting the signature right?
@JacobSorber4 жыл бұрын
The signature should be listed in the library documentation. If not, you can check the header file where the function that takes the callback is defined. The signature should be there, too.
@Raspredval13374 жыл бұрын
every function signature is a data type, so if ur IDE shows the type aliases, it would show u the required function signature
@krystof70594 жыл бұрын
video on linking libraries please? :D I know how to link in ide but not in code editor... Do you have all your library files in same folder?
Nice video. Indeed, this is the easy way to do quick and dirty networking in C. One question still remains - is how portable is thit between different Linux distributions? I already tried to use it on DEB-based ones (works great). But for RPM-based, somehow is causing troubles finding the library. It would be nice if get better explanation how we can make sure the application we write is portable.
@JacobSorber4 жыл бұрын
Hmm... I haven't seen that, but then again, these days most of my work is either on macOS or ubuntu (seems to work fine on both). If you can send me more details about the issue you're seeing, I'll take a look. Always looking for interesting video ideas. Thanks.
@krisdoe4 жыл бұрын
@@JacobSorber I decided to drop you a mail. I don't want to flood the comment section. I hope you don't mind. Maybe after everything is clarified we could share the information with everybody here.
@bobtournoux18253 жыл бұрын
The curl library is certainly a life saver when there isn't time to do the low level socket stuff. Do you have any idea how much of a performance hit using curl instead of the low level socket programming might be? For my case it would be just using curl to to some simple GET and POST calls, but there might be 10 to 20 calls per second. Just wandering if using curl can handle that kind of load.
@OrchidAlloy2 жыл бұрын
It's not as if it's gonna be slower than every Node JS app people use nowadays
@azsxw23 жыл бұрын
This is awesome!
@dhanashreebhoyar552 жыл бұрын
Can I use libcurl in Apache web server module? I tried but I am always getting undefined reference to libcurl API. Can you please make videos on apache+libcurl.
@subhashsarangi4 жыл бұрын
Awesome video... However I'm confused by the usage of curl_easy_setopt function. On line 33 the 3rd arg to this function was a string. But on line 34 it was a function. How is that possible in C?
@JacobSorber4 жыл бұрын
Thanks. They're both pointers. A character pointer and a function pointer are both just addresses. But, this function is implemented as a variadic function (kind-of like printf). I have a video on variadics, if you're interested.
@subhashsarangi4 жыл бұрын
@@JacobSorber Thank you.
4 жыл бұрын
@@JacobSorber I mean, the function may receive void*, but how does curl knows it's a char* or a function pointer?
4 жыл бұрын
I guess it depends on the opt argument, but it still may get in trouble if the pointer passed is not of a type it expects.
@JacobSorber4 жыл бұрын
It determines what it is based on the option you specify. For URL, it looks for a string. For the other, it looks for a function pointer.
@eliaspfeffer3 жыл бұрын
THIS IS GREAT! THANKS A LOT! WOOOOOOOOW YEAH
@subhraneelmukhopadhyay309 Жыл бұрын
I'm getting this error "Makefile:10: *** missing separator. Stop." when i type make
@larrysmall3521Ай бұрын
Sounds like you have a space instead of a Tab on line 10 in the makefile.
@lorensims48463 жыл бұрын
Wheee! "easy"!!
@ColonelPuttu2 жыл бұрын
just found out a *legendary* channel very helpful thanks
@piecepaper28313 жыл бұрын
but how i install curl and link it.
@axelbagi1003 жыл бұрын
Hey man, I need some help The simple curl_easy_setopt(curl, CURLOPT_URL, "https:....") throws an unsupported protocol error I have installed libcurl this way: Downloaded the latest zip, extracted it In the extract location in cmd (Im on win10) used this code: cmake -G "MinGW Makefiles" -S . -B . -DCMAKE_INSTALL_PREFIX=F:\MinGW\mingw64\x86_64-w64-mingw32 Then *mingw32-make all* and *mingw32-make install* Everything is fine but the program doesnt work If I simply use curl from the cmd like this: *curl CURLOPT_URL **www.youtube.com* it works fine What could be a problem? Cant find an answer anywhere
@Massimus8883 жыл бұрын
Thanks! Do you recommend libxml2 for parsing the html document?
@Ryan-mn6xs4 жыл бұрын
Great video as usual! Any plans to do one on Toolchains?
@JacobSorber4 жыл бұрын
Thanks. Are you interested in any specific toolchain?
@Ryan-mn6xs4 жыл бұрын
@@JacobSorber Kind of niche, but musl on mips. Linux to FreeBSD would be interesting as well. More generically the idea of cross-compilation and emulation (qemu) would be a cool topic.
@elrayonegro1004 жыл бұрын
Where can I get that shirt? Excelent video 👌
@JacobSorber4 жыл бұрын
teespring.com/stores/jacob-sorbers-store
@lordr0212 жыл бұрын
I have the json, how to iterate response string readBuffer, containing a json -> curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
@lowrhyan5673 жыл бұрын
Wheres the documentation of libcurl?
@smalinux4 жыл бұрын
You are amazing! thank you
@JacobSorber4 жыл бұрын
You're welcome. Glad I could help.
@lordadamson4 жыл бұрын
that was awesome :D
@JacobSorber4 жыл бұрын
Thanks, Adam.
@vitacell13 жыл бұрын
Can be great some simple game in terminal with p2p game networking.
@amanrohilla44353 жыл бұрын
I'm getting an error with url, SSL certificate problem: unable to get local issuer certificate how to solve it. I'm using windows
@anistatus4u4212 жыл бұрын
thats openssl problem
@hasithapathirage38304 жыл бұрын
How can we cross compile libcurl to work in ARM architecture
@JacobSorber3 жыл бұрын
I haven't tried this, but it would surprise me if someone hasn't. Socket code is fairly portable.
@hasithapathirage38303 жыл бұрын
@@JacobSorber yeah I got it done, thank you for the reply
@Fraket3 жыл бұрын
Thanks for this. Great video. Just bought one of those shirts, btw :)
@JacobSorber3 жыл бұрын
Thanks! Glad I could help you upgrade your wardrobe. 😀I appreciate the support.
@cassiewinger70414 жыл бұрын
Hi, thanks for the tutorials. #awesome. can you make a tutorial about a simple encrypted chat? just a server an a client having sending and receiving encrypted texts? thanks.
@JacobSorber3 жыл бұрын
Interesting. Maybe. What sort of encryption would you be interested in? Just something symmetric (AES?) with a shared key, or are looking for full Public Key/Private Key stuff?
@JohnDoe-ym2oy3 жыл бұрын
@@JacobSorber thats sounds fun!
@juuamjskn24204 жыл бұрын
Thanks!
@JacobSorber4 жыл бұрын
You're welcome.
@willmurphy86504 жыл бұрын
nice video
@JacobSorber4 жыл бұрын
Thanks.
@user-mr3mf8lo7y Жыл бұрын
All good. Buttttt linking Curl statically with your program is really pain. You have been warned.
@maqusss4 жыл бұрын
Is there a problem with print because the charset is UTF-8 ?
@Raspredval13374 жыл бұрын
ASCII translates into the UTF8 without any change, so every English text is ok, but local characters such as Cyrillic or Eastern Europe would be represented as character pairs or triplets, so standard printf would just type some random stuff instead.
@deepakmbirajdar47163 жыл бұрын
How to disable printing the response automatically. How do we get the status code.
@JacobSorber3 жыл бұрын
For disabling the printing, just remove the print statements. I'm doing the printing, not libcurl. For the response code, check this out. curl.se/libcurl/c/CURLINFO_RESPONSE_CODE.html
@deepakmbirajdar47163 жыл бұрын
@@JacobSorber I mean at this point 6:15
@JacobSorber3 жыл бұрын
@@deepakmbirajdar4716 Ok. The video shows you how to specify a "write function" and that allows you to replace the default behavior (turning it off).
@mohdatishan20902 жыл бұрын
Link not working! Low level socket programming link?
@JacobSorber2 жыл бұрын
Weird. Maybe YT changed the link? It's pretty old. I just updated. Let me know if that works for you.
@mohdatishan20902 жыл бұрын
@@JacobSorber Yeah, that works! BTW Huge Respect for replying....
@SimGunther4 жыл бұрын
Postman and Insomnia are capable of creating c code that calls libcurl functions based on endpoint data in the postman request. Learn how the libraries work through documentation first before naively using this generated code in your project.
@ButIfWeSurvive-WeHereInTheEnd Жыл бұрын
is not working (link issue)
@leokiller123able3 жыл бұрын
If you don't want to get annoyed by the "easy" you can just do #define curl_ curl_easy_
@judedavis923 жыл бұрын
Are you into the new M1 Macs?
@JacobSorber3 жыл бұрын
Too soon to say. There have been some benefits to having my Linux boxes and Macs on the same CPUs. I hope we don't lose ground there, but diversity in the market can be a good thing. So, I'm cautiously optimistic, and hoping for the best.
@judedavis923 жыл бұрын
@@JacobSorber hey I was literally watching one of your early websockets videos. Nice channel, keep it going.
@ladyViviaen4 жыл бұрын
c-chad
@dracla263 жыл бұрын
You are such a badass.
@JacobSorber3 жыл бұрын
😀
@geethanisamanthilake9635 Жыл бұрын
Thank you
@jeelpatel4121 Жыл бұрын
its not work on localhost
@user-sl6gn1ss8p4 жыл бұрын
This has nothing to do with the topic at hand, but does anyone know of some examples of test driven development in practice, at some depth? I like the idea but have a hard time seeing how one actually goes about it : p
@thinking-laaf3 жыл бұрын
FTP isn't secure, so it doesn't matter the password is secure or not.
@JacobSorber2 жыл бұрын
Very true.
@georgehaake4 жыл бұрын
t-shirt source please.
@JacobSorber4 жыл бұрын
You can get it from the merch store, should show up right under the video.
@georgehaake4 жыл бұрын
@@JacobSorber Don't see it. Found it via search.
@JacobSorber4 жыл бұрын
@@georgehaake So, strange. I wonder why some people don't see it on YT. Glad you were able to find it. Thanks for the support.
@OrchidAlloy2 жыл бұрын
It's almost as if curl is making fun of you for doing things the easy way
@LinucNerd4 жыл бұрын
Your indentation makes me sad )': *cry*
@pixelPlex4 жыл бұрын
Very useful for developers of C libraries to keep in mind that there are different programming languages other than C that can use C libraries (eg Kotlin - kotlinlang.org/docs/reference/native/c_interop.html ). C library developers need to design APIs in a way that can be usable for other programming languages (eg don't use macros as part of the public API). Here is a sample project that uses libcurl: gitlab.com/napperley/curl-example
@noxabellus4 жыл бұрын
Macro usage isnt going to stop anyone from making an ffi wrapper for your library; In fact there isnt really much you can do that precludes an ffi wrapper for your c library. The universal compatibility of C is exactly why other languages have ffi for it. On the contrary, you shouldn't hamper the lib consumer's experience in primary language just to simplify the process of writing a wrapper for it. Things like defines for constant expressions dont have good alternatives in C and you shouldn't avoid them. Translating them to the wrapper language is much simpler than working around the lack of them in c.
@radio_electronics40479 ай бұрын
This video is not that helpful because you do not store the data in a variable and are not able to use that data in the rest of your program, you just have it in a callback function. And getting that data into a variable is the most complicated part in libcurl.
@laptoprecaia.k.aagentsmith33283 жыл бұрын
.
@sheditz49623 жыл бұрын
≡
@esgosar2 жыл бұрын
clean this Mac screen
@ASAPSIDJ4 жыл бұрын
libcurl is bloated, too bad all the HTTP libraries suck