Making HTTP requests from a container that has no curl, using bash /dev/tcp

16 points by indigo


thomas0

I just had to deal with this exact problem on OpenBSD today!

I found that it also didn't come preinstalled with curl or wget so I wondered how people test out httpd and I got pointed to the ftp program which will download an http url. I know I could install curl and wget but I learned something by not taking the easy route :)

Seeing that bash could support it, I gave it a try on ksh the default shell on OpenBSD to see if I could use that trick and it doesn't work. I probably should have guessed this is a bash specific trick from the blog post, but I wanted to try it anyways.