How I said, when you will not update the Mbed Os library to newest version, the example will work I think.
However, you can check other questions with same/similar Issue.
- Any suggestion for mbed HTTP library (mbed-http not work with recent mbed-os)
- Webserver with WebSockets für mbed-os5
BR, Jan