You can use several C libraries. Some C libraries provide HTTP server abilities, e.g. libonion or libmicrohttpd. Other libraries provide HTTP client abilities, e.g. libcurl
All are using some event loop, e.g. libev, libevent or at least some multiplexing syscall like poll(2)
You could also make your application a FASTCGI app.
Reading Advanced Linux Programming should help.